Running PHP5 on IIS 6
I love ColdFusion, ask anyone I work with. Though, I know it doesn’t always offer the best solution (yet,
). One example of this is administering MySQL. I know there is a CF based solution called CFMyAdmin. I am not knocking the developers of CFMyAdmin, they came up with a good product… it’s just not what I am used to. I cut my teeth in web development using PHP, and for MySQL administration, there is no better tool, in my humble opinion, than PHPMyadmin.
However, as you may have guessed, you need PHP to run it. I am also a Windows guy. I don’t want to knock any of the alternatives. I use Windows, for no other reason than convenience. I think it’s easier.
Getting PHP to run on Windows should be relatively simple. I mean, they have an installer for it, should be simple, right? Maybe. PHP is also pretty popular, so there should be some good, informative resources on how to install PHP with IIS, right? Not so much. At least not PHP5 on IIS 6. Until now. Here is a step by step process on how to install PHP5 on a Windows 2003 server running IIS6.
- Download PHP, the .zip file, not the installer –You can get it here, I used 5.0.3.
- Decompress PHP – I chose C:\php (for the purposes of this tutorial, I will assume you did the same)
- Open the file C:\php.ini-recommended in a text editor and save it as C:\WINDOWS\php.ini.
- Make the following changes to C:\WINDOWS\php.ini:
Replace extension_dir = "./" with extension_dir = “C:\php\ext”
Replace cgi.force_redirect = 1 with cgi.force_redirect = 0
- Close php.ini, we are done with it for now. There are other values you can set or change, but for the basic set-up, that is all we need.
- Copy C:\php\php5isapi.dll into the C:\WINDOWS\System32 directory. (Alternatively, you can add the C:\php directory to the PATH)
- Open IIS – Start-->Control Panel-->Administrative Tools-->Internet Information Services.
- Expand the web server, and right-click on ‘Web Server Extensions” and choose ‘Add a new Web Service Extension’
- In the window that pops up enter the name of the extension, it can be anything, but make it descriptive. I chose (surprisingly) PHP.
- For the required files, enter ‘C:\php\php5isapi.dll’ or browse to the files location.
- Make sure the check box to allow the extension is checked an click ‘OK’
- In IIS Admin, right-click on ‘Web Sites’ and choose ‘Properties’ or you can select the site you wish to enable PHP for, and right-click ' properties'.
- Select the ‘Home Directory’ tab, and set the ‘Execute Permissions” to ‘Scripts and Executables’
- A window will pop-up which references other sites affected by this change, choose which sites (if any) you wish to include on the PHP install, and click ‘OK’.
- Now, click the ‘Configuration’ button.
- Under ‘Application extensions’ click ‘Add’
- In the small window that pops up, enter ‘C:\php\php5isapi.dll’ or browse to its location, in the Executable box, and enter, ‘.php’ in the extension box.
- Make sure ‘All verbs’ is selected, take the check mark off Verify that file exists, leave only script engine checked and click on ‘OK’.
- This step is optional: Click the ‘Documents’ tab. Click on ‘Add Content Page’. Enter ‘index.php’ click ‘OK’ Use the ‘Move up’ and ‘Move Down’ buttons to position ‘index.php’ to where you want it to be.
- Re-start IIS.
You should now have PHP running on the site(s) you chose. Now let’s test it. Create a PHP page and in it place the following code:
When you browse to the page, you should see a page that contains all the information about your PHP configuration.



Thanks for the great entry! Trying to get tinyMCE Spell Checking working so I had to install PHP. Just a quick suggestions, alternatively to the steps above "Open the file C:\php.ini-recommended in a text editor and save it as C:\WINDOWS\php.ini." you can set a System Variable named "PHPRC" that points to the "C:\PHP" folder if you don't want to move stuff into the "C:\WINDOWS" directory.