Installing PHP on Windows 7/IIS 7 with Windows Platform Installer

Download the Web Platform Installer from http://www.microsoft.com/web/Downloads/platform.aspx.  Must do this when connected to the Internet, since the installers download the latest components from the web.  You also need to install PHP before you install the PHP-based applications, too.

After you download the small installer, run it, and you’ll see an Open File warning.  Click Run to continue, and the installation will begin.

image 

image

At this point, you’ll receive a UAC warning.  Allow the WPI to install itself.

image

It was at this point I received an error on my first try (see below).  Upon retrying the installation, it worked.

Once the WPI is installed, it will update itself with the latest packages and components.  You’ll receive another UAC, and then you’ll see this window, where you can add components or apps.

image

To install PHP, select the Web Platform tab, then under “Frameworks and Runtimes” click Customize, then choose PHP from the list.

image

Click Install, and review the list of components that will be installed.

image

Click I Accept, and installation will begin.

image

After a few minutes, you’ll have PHP installed on your system.

image

Configuring Expression Web 3 for PHP

The PHP components are installed in c:\program files\php.  If you use Expression Web 3, you can configure PHP under Tools >> Application Options >> General, then browsing to the php-cgi.exe.

image

Testing the PHP Installation

To test your PHP installation, open the IIS Management Console and create a new application.  Inside of this application, add a file named test.php and with the following code in it:

<?php
Print "Hello, World!";
?>

Load this file in your web browser, and if you see the message, you’re set to go!

image 

Installation Error

The first time I ran through the installation, I received the following error:

The Web Platform Installer  could not start.  Please report the following error on the Web Platform Installer forum.  http://forums.iis.net/1155.aspx

I checked out the Application Log, and that was no help:

Product: Microsoft Web Platform Installer 2.0 RC — Installation failed.

Before I went to the IIS forum, I tried to recreate the issue by running the installer again, and this time it worked.  So if you get this error, wait a moment and try it again.