how to host php on IIS 7.5

Php application can be hosted on IIS web server by using FastCGI Module that can be found in IIS. Here I am using Windows 7 as my IIS web server. Same is for server 2008 R2. Remember R2 has IIS ver7.5 ditto Windows 7.

First you  need to install IIS in your server, make sure that you have installed CGI feature while installation.


Now you need to Install and Configure the php to run for IIS.

You may go to and download the php zip file for windows.

Unzip the downloaded file somewhere like C:\php . Now rename the php.ini-recommanded to php.ini .

Now eopne php.ini and then uncomment and modify to following:

set fastcgi.impersonate = 1

Set cgi.force_redirect=0

Set cgi.fix=pathinfo=0

open_basedir and edit to your desired directory

Set extension_dir to the directory where php extension reside in this case C:\php\ext

Enable following by uncommenting:



Here your Configuration part is over. Now you need  to handle to php Request. As I have mention before we will be using FastCGI for this purpose here.

Open your IIS manager. “inetmgt” Now double click on “Handle Mappings”


Now add Module Mapping and point phpCGI.exe for php files.

Now here what you need to do.

module mapping

You will get a dialogue box stating FastCGI application. Click on “Yes” and you are good to go for php apps.

You may want to create a php info file in wwwroot  folder like this <?php phpinfo(); ?> and test.



Posted: 02-21-2010 6:00 AM by gandip

Filed under: