This is the third part of the Installing WordPress From the Ground Up series.   Previously I discussed installing MySQL and then installing FastCGI on IIS6.   This article will show the exact steps for setting up PHP on Windows and IIS.

PHP is an open source general-purpose scripting language especially suited for web development.   WordPress along with many other applications are built on top of PHP.   PHP is available on several platforms, but it appears that the most common platform on which it is used is Windows.   If you click the downloads link on the site you’ll see download links for source code and Windows binaries.   My recommendation is to download the installer package.   As of this writing version 5.2.9-1 was available.

Choosing Your Web Server

The first major decision in setting up PHP is which web server to use.   Most of my experience up to now has been with the IIS ASAPI module.   However, I have been reading that IIS FastCGI is better solution (see the articles at referenced below) so that is what I’ll recommend here.   FastCGI support is built in on systems that include IIS 7.0, such as Windows Vista and Windows Server 2008.   For systems with IIS 6.0 (e.g. Windows Server 2003 and Windows XP) you’ll need to download and install the FastCGI Extension.   The wizard won’t let you continue without installing it, so let’s do that now.

Web Server Setup

The pages of the setup wizard preceding the web server choice should be self-explanatory.   On this page, select IIS FastCGI extension.

Note that for some reason the wizard allows you to click the Next button without making a selection, so don’t forget to select something before clicking Next.

Web Server

Choose Items to Install

It is tempting to take a look through the list of extensions included with the installation package and select ones that sound interesting.   Resist that temptation.   Unfortunately not all extensions are created equal – or are designed to work with one another.   It is recommended that you only install the extensions that you know you will need.   You can always install extensions you missed at a later date.

Choose Items to Install

With that said, the following extensions are commonly installed on system to be used for WordPress:

  • Curl – Client URL library functions.
  • GD2 – GD library image functions.
  • Multi-Byte String – Multi-byte string functions
  • Mcrypt – Encryption functions
  • MySQL – For interfacing with the MySQL database server in which all WordPress data is stored.
  • zip – A zip management extension.

PHP Configuration

You may want to make some changes to the PHP configuration file found in the PHP installation directory (e.g. C:\Program Files\PHP).  Here are some that you should consider.

  • fastcgi.impersonate – Set this to 1 on Windows.
  • cgi.fix_pathinfo – Set this to 1.
  • cgi.force_redirect – Set this to 0.
  • date.timezone – Set this to one of the timezones listed at See PHP Failure Due To Missing Timezone for details on why this is important.
  • open_basedir – Set this to to the root of your web site files (e.g. C:\Inetpub) if you want to restrict PHP to a specific folder hierarchy.   If not, leave this commented out.
  • upload_tmp_dir – Defaults to C:\WINDOWS\Temp.   Set this to a different location if you are concerned about the space available on the system disk.
  • session.save_path – Defaults to C:\WINDOWS\Temp.   Set this to a different location if you are concerned about the space available on the system disk.
  • SMTP – Defaults to localhost.   Change this if your SMTP host is on another machine.


Once you’ve completed the installation, you can test it to make sure it is working correctly.   Create a file called phpinfo.php in the C:\Inetpub\wwwroot directory:

<?php phpinfo(); ?>

Next, navigate to http://localhost/phpinfo.php.   You should see something like this:

Testing PHP

The next article in the series will cover installing phpMyAdmin to manage databases hosted by the MySQL database server.