Installing PHP on Windows and IIS
Table of contents for Installing WordPress On IIS From the Ground Up
- Installing MySQL on Windows
- Installing FastCGI on IIS6
- Installing PHP on Windows and IIS
- Installing phpMyAdmin on Windows and IIS 6.0
- Preparing to Install WordPress on Windows and IIS
- Installing WordPress (Single-User)
- Troubleshooting on IIS7
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 php.net 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 iis.net 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.

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.

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 to1on Windows.cgi.fix_pathinfo– Set this to1.cgi.force_redirect– Set this to0.date.timezone– Set this to one of the timezones listed at http://us2.php.net/manual/en/timezones.php. 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 toC:\WINDOWS\Temp. Set this to a different location if you are concerned about the space available on the system disk.session.save_path– Defaults toC:\WINDOWS\Temp. Set this to a different location if you are concerned about the space available on the system disk.SMTP– Defaults tolocalhost. Change this if your SMTP host is on another machine.
Testing
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:
The next article in the series will cover installing phpMyAdmin to manage databases hosted by the MySQL database server.
Resources:
- PHP on IIS at IIS.net
- Configuring FastCGI Extension for IIS 6.0 by Ruslan Yakushev
- IIS7: Install FastCGI & PHP on Server 2008 by Dave Lawlor




June 3rd, 2009 at 7:08 am
hey, i tried to install this just as you had written and I get an error. I don’t have a php-cgi.exe file in my PHP folder. Have you ever run into that?
June 3rd, 2009 at 7:50 am
wow, just reinstalled a different binary, non-threaded and it seems to work, so thanks!
January 14th, 2010 at 1:18 pm
[...] PHP: Installation on Windows systems – Manual How To Install PHP on IIS 6.0 IIS Admin Blog Installing PHP on Windows and IIS | David’s Technical Musings Installing PHP 5 on IIS in 5 simple steps | IIS Aid Otherwise if you have a spare PC try using [...]
February 22nd, 2010 at 3:55 am
Hi, in actual fact just moved on to installing phpMyAdmin but it is at this point it comes back with an error suggesting there is a problem with the php installation.
“Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.”
yet there is nothing in either the php log file or iis!!!
any ideas please…so close yet so far
February 22nd, 2010 at 4:56 am
just run my phpinfo test which works fine and creates the session 0 byte file..is there any value in me emailing u the results of the phpinfo?
many thanks
david