Wednesday, March 10, 2010

How to install PHP 5.2 on Windows 2003 Server with IIS6

Let's skip all the blabbing and  go straight to the content.


1.    Windows 2003 Server
2.    IIS6 Web server
3.    PHP 5.2.13 binaries zip file (Download here)


1.    Unzip the content of the zip in the following location "C:\php5"
2.    Copy "C:\php5\php.ini-recommended" to "C:\WINDOWS"
3.    Rename the previous file to "php.ini"
4.    Copy "C:\php5\php5ts.dll" to "C:\WINDOWS\system32"
5.    Open IIS Manager - Expand your server - Right click on "Websites" - Properties - Home Directory - Configuration - Add
6.    Browse and select the file "C:\php5\php5isapi.dll" and set the extension value to ".php" and click "OK"
7.    Now in the same "Websites" properties window, go to the "Documents" tab
8.    Click on "Add" and enter this value "index.php" and move it to the top
9.    Right click on the "Web Service Extensions" and add a new one
10.    Set the extension name to "PHP", then click on "Add" and select the file "C:\php5\php5isapi.dll"
11.    Tick on "Set extension status to Allowed"
12.    Create a text file with the following content " to test our installation:
 <?php phpinfo(); ?>  
13.    Save the file as "index.php" in the following location "C:\inetpub\wwwroot"
14.    Open your internet browser and open "http://localhost" or "http://localhost/index.php"

That should it be it! you should get a PHP info similar to this one: