How to install PHP 5 on Windows Server 2003 running IIS6

This is a quick guide on how to install PHP in a Windows environment, this tutorial is based on a Windows 2003 Server running IIS6. My goal was to build PHP using the manual method utilizing ISAPI rather than CGI.

For earlier versions of IIS, you may be able to skip a few steps, as noted below, but if you have issues, let me know and I will try to help.

This tutorial comes with no warranty, just trying to help out.

I downloaded the php 5.2.9 ZIP file, (not the MSI installer) so make sure you have that first.
Note: If your version is php 5+ but not 5.2.9, this tutorial SHOULD work fine. But who knows what the future holds.

If you need clarification on anything, please submit a comment, these are from my personal notes so they may seem somewhat cut and dry.

0. create c:\php, note if you don't use c:\php, just make sure any reference to c:\php is updated on your end
1. extract the zip into c:\php folder

2. Update System Environment and System variables
a. Go to Control Panel -> System -> Advanced Tab
b. Click Environments Variable Button -> Look in System Variables Pane ->
c. Edit Path -> Put "C:\php" as the last path.
d. Click "New" -> Create a variable called "PHPRC" and point the path to C:\php
e. Reboot your computer.

If you do not do step 2 items correctly, your configuration path to C:\php\php.ini may not work properly.

3. Open IIS
    FOR IIS 6 follow steps a.-d.
    This tutorial was done on an IIS 6 machine, but you should be able
    to skip steps a-d if you are using a lower version of IIS, if you are having issues using a lower version, comment in this solution and I will try to help you.
    a. Click on Web service extensions
    b. Click Add a new Web service extension button/link
    c. Browse for php5isapi.dll (should be in c:\php)
    d. check the  "Set Extension Status to Allowed"
    e. Right Click on default web site -> Properties
    f. Click Home directory tab
    g. make sure Execute permissions = Scripts only
    h. click Configuration
    i. click Add and search for php5isapi.dll, make .php the extension
    j. go to Documentst tab
    k. click add and enter "index.php"
    l. I moved mine to the top using the "Move Up" button

4. PHP.INI (located in c:\php)
Open the file.
    a. update doc_root to c:\inetpub\wwwroot
    b. set extension_dir = c:\phpext
    c. uncomment extensions (mysql) or whatever else you need. Just get rid of the trailing semi-colon.

Reboot the web server.

To test, create a file using the phpinfo() command and you can see if everything worked.

One note, if you ever need more extensions in the future, follow step 4.c again, but reboot the web server to make the new extensions available. People say you don't have to, but I always have to.

Keywords: php 5 windows install, php manual install isapi windows

Submit a Comment



Posted on: Jun 5, 2009 7:10 am

PHP 5 is nice and the GUI is even nicer very user friendly ^_^