The process is simple and straightforward:
Once Apache is up and running, add PHP (4 - 5 should be the same but substitute 5 for 4 in filenames):
1. Start | Programs | Apache HTTP Server | Configure Apache Server | Edit Configuration. This will open the httpd.conf file in your default text editor.
2. All of the options in this long and intimidating configuration file should have been set up correctly by the Apache install program. All you need to do is add the following three lines to the very bottom of the file:
LoadModule php4_module c:/php/sapi/php4apache2.dll
AddType application/x-httpd-php .php .php3 .phtml
AddType application/x-httpd-php-source .phps
Make sure the LoadModule line points to the appropriate file in the PHP installation directory on your system - be sure to use slashes (/) instead of backslashes (\).
3. The line that begins with DirectoryIndex tells Apache what file names to use when it looks for the default page for a given directory. You’ll see the usual index.html and so forth, but you need to add index.php, index.php3, and index.phtml to that list if they’re not there already:
DirectoryIndex index.html … index.php index.php3 index.phtml
4. Save your changes and close the editor.
5. Restart Apache by choosing Start | Programs | Apache HTTP Server | Control Apache Server | Restart. If all is well, Apache will start up again without complaint.