Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem configuring Apache to interpret PHP on Win98

Status
Not open for further replies.

MHUK

Programmer
Nov 30, 2002
139
GB
I am having a bit of difficulty installing Apache & PHP on Windows 98 and configuring Apache to interpret PHP. First of all I downloaded the following Apache version: apache_1.3.27-win32-x86-no_src.msi. I saved the file to my C: drive in a folder called Apache. I double clicked the file I had just downloaded in order to start the installation process.

During the installation procedure the wizard prompted me to enter a Network Domain, where I typed "localdomain" & a Server Name where I typed "localhost". After this I selected a radio button to make Apache 'Run when started manually'.

I tested the installation by opening a web browser and typing ' The Apache server page was displayed correctly as expected. To start the Apache server I go to the Windows Start Menu, select 'Programs', then select 'Apache HTTP Server', and select the option 'Start Apache in Console'. This brings up a DOS window stating "Apache/1.3.27 (Win32) running...". Is this a correct way of starting the Apache server?

To stop Apache I simply click the cross in the right-hand corner of the DOS window. Is this the correct way of stopping the Apache server?

Now I come to the installation of PHP. I visited the website and went to the section called ‘Windows Binaries’ and downloaded the zip file called PHP 4.3.0 zip package. I downloaded the zip file to my C: drive in a folder I named php. I then extracted all the files in the zip file to the same folder. I copied one of the extracted files called ‘php.ini-dist’ to C:\WINDOWS and renamed it as ‘php.ini’.

Finally I had to configure Apache for PHP. (This is where I am having major problems.) I did this by going into the following file C:\Apache\conf\httpd.conf. I opened the httpd.conf file in Notepad (a text editor). I went to the section of the file that had ‘AddType’ instructions. I inserted the following four lines:
“AddType application/x-httpd-php .phtml .php .php3 .php4”
“AddType application/x-httpd-php-source .phps”
“ScriptAlias /php/ “c:/php/”
“Action application/x-httpd-php “/php/php.exe”

Are the four lines correct? The full location for the php.exe file is: C:\php\php-4.3.0-Win32. I am not sure whether the last ‘Action’ line that I added was correct. The main question I have is what additions have to be made to the php.ini file that I copied into C:WINDOWS? There is something in the php.ini file called doc_root and user_dir in a section called Paths and Directories. Should they both be assigned something?

To carry out a test I created a PHP script in Notepad as follows: ‘<?php phpinfo(); ?>’. I named the file as phpinfo.php and saved it to the ‘htdocs’ folder in C:\Apache. To run the script I opened a web browser and typed ‘ The result was that ‘<?php phpinfo(); ?>’ was outputted to the screen. This is not correct. The problem is something to do with the configuration. Please can someone help me?
 
You need to have the paths in the httpd.conf match the path to php. So either change the php directory to c:\php or change the httpd.conf to C:\php\php-4.3.0-Win32. I'd recommend the former, since that way if you upgrade PHP, you don't need to change your apache configuration. --
How can you be in two places at once when you're not anywhere at all?
 
Thank you both for your answers. Much appreciated. I tried changing the paths in httpd.conf to match the path to PHP using both methods, although neither worked.

I then tried downloading PHP, MySQL, and Apache from All 3 have worked fine and are automatically configured to work with each other when you download the .exe file from the website. When you download the easyphp.exe file from the website you are in fact downloading PHP, MySQL and an Apache server all together.

I'd recommend this website to any other users who are new to PHP and MySQL and want to get programming straight away, as opposed to spending a lot of time installing.

Thanks,
MHUK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top