Tech Tip: PHP on IIS 7

The following post is for anyone running Windows Server 2008 and wants to host dynamic webpages using PHP scripting.

A couple of years ago I wrote a step by step process of installing PHP on IIS 6 on a Windows Server 2003. I wrote it because many of the steps they had online were sometimes incorrect, had gaps, missed steps that were crucial in setting up PHP. With the release of Windows Server 2008 Microsoft also updated it’s Internet Information Services to version 7. IIS7 has lots of new features and one of the in nicest addition is its ability to easily install PHP, compared to installing it on Windows Server 2003.

I wrote the following steps a year ago for documentation purposes. It should be the same process for Windows Server 2008 R2. I didn’t add screenshots because I’m assuming you’re familiar with Windows Server 2008’s GUI.

-Add the IIS Web Server role.  Be sure CGI feature is installed.

-Download the PHP binary for Windows at

-You will need to download and install Microsoft 2008 C++ Runtime (x86) if your OS is 64-bit

In this tuturial we’ll be using the zipped package rather than the installer.

-Unzip the contents to C:\php

-In C:\php directory rename one of the php.ini-xxxx to just php.ini

-In the php.ini file uncomment and set the vaule of the string to:
(To uncomment a line you just delete the semi-colon at the beginning of of line of code)

upload_tmp_dir = C:\Inetpub\wwwroot\uploads (you will need to manually create this ‘uploads’ folder)
date.timezone = america/tijuana     (be sure to select your correct time zone. You can look up your time zones here:

If you plan to use extensions you will need to uncomment the line corresponding to the extension you want to use.

-Open your IIS Manager

-Select your host and click on Handler Mappings

-Add module mapping

-Fill out the Module mapping info

Request path:   *.php
Module:   FastCGIModule
Executable:   C:\php\php-cgi.exe
Name:   php fastcgi

Make sure your php fastcgi is “enabled”

To test your php open up notepad and type in  <? php phpinfo(); ?>
Now save the file as info.php. Place the file in C:\inetpub\wwwroot\
Open up your browser and point it to your info.php file  (C:\inetpub\wwwroot\info.php
If all is successful you should see your PHP info and it’s configuration for your server.

Host jad and cod files on Windows IIS

For those of you who have Blackberry devices you may have downloaded applications over-the-air (OTA). Blackberry devices uses a .jad file to download OTA apps by pointing its browser to that file. OTA apps actually consists of two file types .jad and .cod. The .cod files are actually the content of the application and the .jad files points to it.

If you plan to host your own OTA files on a Windows IIS server you’ll need to make some changes to your web server to process those .jad and .cod files.

You will need to access Internet Information Services and right-click on Web Sites and select properties. Select the HTTP Headers tab and click on MIME Types. Here you will add two MIME Types:

Extension: jad
MIME type: text/

Extension: cod
MIME type: application/vnd.rim.cod

You may need to restart IIS once you’ve added the MIME types. Open the command prompt and type in “iisreset” (minus the quotes).