IIS 7's management interface sports a very different look to previous versions of IIS. Here is a rough guide for setting up IIS 7 with PHP, which will enable you to run PHP web applications. It assumes that you have completed the Installing PHP section from the Setting up PHP with IIS 6 on Windows XP article.

Enable CGI in IIS

Since we are going to run PHP as a CGI module, we must first enable this ability within IIS 7.
  1. Go to Control Panel -> Programs and Features,
  2. Click Turn Windows features on or off,
  3. Expand the Internet Information Services -> World Wide Web Services -> Application Development Features items,
  4. Check the CGI option and click OK.

Load the IIS Manager

Most of the following steps will be done in the IIS Manager.
  1. Click Start, search for IIS Manager and click it to load it up.
  2. Under Connections on the left, expand the tree until you get down to Sites -> Default Web Site (or whichever web site you wish to install PHP on).
This Default Web Site screen is where the next steps will begin.

Configure IIS with PHP

Setting the correct permissions
First, find out what user we need to give write access to by
  1. clicking on the web site you are going to install the PHP application to,
  2. going into the Authentication area,
  3. editing the Anonymous Authentication item, and
  4. noting down the user it displays. By default it will be IUSR.
We must now set the appropriate access permissions on the folders we created when installing PHP.
  1. Right-click on the C:\php\session directory and go to properties, click the security tab, click Edit, click Add and in the box type in the name you copied down before (probably "IUSR").
  2. Click Check Names and it should underline the name, then click OK.
  3. Click Modify and it should check all the other necessary boxes for you, then click OK.
  4. If there is no security tab, then in Windows Explorer:
    1. Go to the Tools menu, choose Folder Options.
    2. Choose the View tab and find the option called Use simple file sharing (usually the last one) and untick it.
    3. Click Apply, then OK.
    4. Go back to the previous step.
  5. Repeat this for the C:\php\upload directory and any other directories which need to be writeable by your PHP application.
Setting up the default document
This will tell the webserver to look for an index.php file if just given a directory.
  1. Back in the IIS Manager, double-click Default Document.
  2. Click Add, then enter index.php and click OK.
Install PHP into IIS via CGI
Now, still in the IIS management console for your web site:
  1. go into the Handler Mappings area and click Add Module Mapping,
  2. enter the Request Path as *.php,
  3. set the module to CgiModule (if this is not an option, you will need to follow the Enable CGI in IIS steps above),
  4. set the executable to C:\php\php-cgi.exe,
  5. enter PHP via CGI as the name, and
  6. click OK and then click Yes to the prompt.

Test PHP is working

In order to test PHP is working with IIS:
  1. start up your web server (or restart it if it was running),
  2. create a file in your web root (possibly C:\inetpub\wwwroot) called index.php with the contents
    <?php phpinfo(); ?>
  3. browse to the web site in your web browser via its URL (e.g. http://localhost).
It should bring up a PHP 'info' page which will let you check that MySQL is enabled, the session.save_path is right etc. which will verify that PHP has been set up successfully.