When I started learning WordPress I used the Microsoft Web Platform Installer as recommended on the WordPress website. This was nice in that it setup PHP, MySql, and WordPress for me with minimal effort. However it also installed IISExpress even though I already have IIS7 on my machine. I have built and hosted several websites on IIS before, so I am not afraid of it. After messing around with WordPress for a while I decided to move it to IIS7 since that is what I am more comfortable with and it is what I will be running in production.

I used the Web Platform Installer again, but this time I launched it from within IIS7, and selected to create a WordPress site. This process allowed me to specify the name of the site, the application pool, and the virtual path for the install.

Wordpress Site OptionsThe installer also setup a fresh MySql database and user account and took care of the necessary permissions. I added index.php to my default documents list and pulled up the site on localhost and was greeted with this error:

HTTP Error 500.21 – Internal Server Error

Handler “PHP53_via_FastCGI” has a bad module “FastCgiModule” in its module list

A bit of googling revealed that it was necessary to install CGI extensions, which was a simple process (via hagrin.com).

  • Open Control Panel and Select “Programs and Features”
  • Click “Turn Windows features on or off”
  • Expand the tree to “Internet Information Services” -> “World Wide Web Services” -> “Application Development Features” and check “CGI”

Installing CGI Extensions

After following these steps I received another error:

HTTP Error 500.0 – Internal Server Error

File monitoring is enabled for a file which could not be found

This error was harder to track down, but I eventually figured out that the path for FastCGI was set incorrectly in IIS. For me this needed to be set to C:Program Files (x86)IIS ExpressPHPv5.3php-cgi.exe, but it will depend on where your copy of PHP was installed.

  • In IIS go to “Handler Mappings” (in my case this was set at the site level, but it could also be set at the server level)
  • Find the mapping for the path *.php and edit it (in my case the name was PHP53_via_FastCGI)
  • Update the path to the executable php-cgi.exe (this will depend on the directory where PHP is installed on your machine)

With this out of the way my WordPress site was finally up and running in IIS7.

Configuring the PHP Module