Before we configure PHP to work with IIS. The machine must have prerequisite like IIS with all the features installed and running including ISAPI Filter.
Lets check the PHP part:
– Download PHP and extract that to in D Drive from this link http://www.php.net/downloads.php
Open IIS
– Go to run, type inetmgr press enter
– When Internet information management windows opens, double click on Handler Mappings
– When Handler mappings opens, now click on Add script map from the right hand panel.
– In the Add Script Map window, add *.php in the Request path, click the button next to Executable and select php5isapi.dll file from php installation folder (i.e. D:\php, if you have installed php on D drive), add a name like php in Name field and click OK.
– Now go to the Internet Information Management first page by clicking on Back button
– Then double click on Isapi Filtes. Click on Add from right hand panel.
– Add *.php in the Filter name and select php5isapi.dll from the php installation folder by clicking on the button next to Executable field.
– Now need to test if IIS and PHP both are working or not
– Open Internet Explorer and browse localhost
– It should open IIS – localhost page
– Now create a test.php file with this code and save this test.php file inside C:\inetpub\wwwroot
– Open Internet Explorer and browse localhost/test.php