Install PHP on IIS 6

By: Team (Support)   Posted on: February 2, 2011

Download the latest PHP version for Windows from PHP website . You can use the Windows Installer package but it only installs and configures the CGI version of PHP which is not the best solution for an IIS web server; you should try to use the ISAPI version. Download the specified version and unzipped to the folder c:\php
locate the file ‘php.ini-recommended’ in C:\PHP and rename it to php.ini




Open the ‘php.ini’ file and find the line which reads extension_dir = “./” and change it to
extension_dir = “C:\PHP\ext”. [This tells PHP where the various extensions are located ]

Launch the "Internet Information Services (IIS) Manager" from the start menu. (You can launch this by typing intemgr in the Windows Start>Run box). IIS Manager appears on the screen. Right-click on "Website" and select "Properties"




Select the "Home Directory" tab in the "Website Properties" window and Click "Configuration" button




Application configuration window appears on the screen. Click on "Add" button




Add/Edit Application Extenstion Mapping Window appears, in that Add "C:\Program Files\PHP5\php5isapi.dll" (including quotes) to "Executable" text box and add .php as "extension". Then limit the verbs to GET,HEAD,POST,TRACE and click on "OK" button.




Now choose the "Documents" tab in the "Website Properties" window and select "Add"




Enter index.php in the text box of "Add content Page " window and click on "OK " button.




Now, you can change the priority of your index.php with the "Move Up" button. This is only necessary if you run primary a PHP based website Click 'OK'




Come back to "Internet Information Services (IIS) Manager" window, select Web Service Extensions on the left side and choose "Add a new Web service extension"




Select "Add" and enter as path C:\Program Files\PHP5\php5isapi.dll and click on 'OK'




Enter php5 as extension name and check "Set extension status to Allowed". Click on "OK" button to enable this extension.




Copy C:\Program Files\PHP5\php.ini-dist to C:\WINDOWS\ folder and rename it as php.ini and restart IIS. (Type iisrest in Stat>Run window for restarting the IIS)




Now write a simple PHP fille in the notepad with <?phpinfo(); ?> and Save this file under C:\Inetpub\wwwroot\test.php.




launch Internet Explorer and go to http://localhost/test.php . PHP info page will appears in the browser only if your PHP5 installation was successfull.




A Technical blog for Website Owner's

Categories