You may have considered setting up PHP on your Microsoft Windows server that's running Apache, but thought that it would be too tedious or clunky to be worth the effort. Wrong! We'll get you up and running in no time flat with this speedy little tutorial!
Create a directory for php on your machine, i.e. c:\php
Extract the downloaded binary to a temporary location and then copy all the files from the unzipped directory to your c:\php directory.
Note: the above steps for PHP version 4.X, there might be slight change in other versions.
Second Step: Configure Your Apache Server
The first thing you will need to do is to load php as a module so it's able to parse php. Script changes should be made in the httpd.conf file, typically found in the directory "C:\Program Files\Apache Group\Apache\conf". Search for the "LoadModule" statement and add the following directly after it:
LoadModule php4_module "c:/php/php4apache.dll"
Note: If you are using apache version 2.X then use "c:/php/php4apache2.dll" instead of "c:/php/php4apache.dll".
Now search for "AddType" in the conf file and at the end of the AddType statement add the following:
AddType application /x-httpd-php .php
If you wish to use index.php as the default page for a directory, search for "DirectoryIndex" and change the line that says
"DirectoryIndex index.php index.html"
Create a test php file to test the installation. Use the following php code in the test file:
Save this file as "phpinfo.php" and store it in your apache htdocs directory.
Restart the apache server and type
in your browser to check to see if it is configured properly.
Installing PHP to work with the Apache web server on Windows is not the huge challenge that it once was--so now you don't have any excuses--get out there and try it on your own server!