Tech Help - providing the average home user with valuable information and tips on topics such as computers, the internet, and home electronics
Google
How To Setup Apache Web Server for Windows
How to install and setup the Apache Web Server with PHP extensions
February 28, 2006
Peter Davis
3. Install PHP
A. Create a folder to hold required php files (c:\php)

B.You Don't need to unzip the whole zip file, just a few select files. Extract the following to the folder you created: Php.exe, Php5ts.dll, Php5apache2.dll OR php4ts.dll, php4apache2.dll, depending on which PHP version you downloaded.

C. Now you need to configure the Apache Web Server. (i) Open the httpd.conf file located in C:\Program Files\Apache Group\Apache2\conf\ (ii) In the httpd.conf file search for an area where there are a whole bunch of LoadModule lines then add the following: LoadModule php5_module "C:/Program Files/Apache Group/php/php5apache2.dll" (iii) Search for an area where there are a whole bunch of AddType lines and add the following: AddType application/x-httpd-php .php (iv) Find the DirectoryIndex line and add index.php as an entry. This way Apache will recognize PHP index files.

v. Create a PHP file and place it in the htdocs folder (C:\Program Files\Apache Group\Apache2\htdocs) (See Figure 6)

Figure 5: Apache Config for PHP
Figure 5: Apache Config for PHP
Figure 6: Hello World!
Figure 6: Hello World!
(vi) Open the Apache monitor (from the system tray) and click on Stop, wait for the services to stop and then click Start. If you close and open the Apache Monitor it should tell you at the bottom whether the PHP extensions are installed and running (Figure 7). (You may have to restart the monitor)
Figure 7: Apache Monitor (PHP Installed)
Figure 7: Apache Monitor (PHP Installed)
Final Test
Open your web browser and type 'localhost/index.php' (without quotes) into your address bar and hit Enter and if everything is working properly you should see a page similar to Figure 8.
Figure 8: Done and Done!
Figure 8: Done and Done!
Now you should be able to create any pages you want and place them in the htdocs folder to test them out. Have fun!
Page: 2 of 2
You can submit your own article and have it published on Tech Help. Click on the link above for more details