We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now


Windows 2003 Server IIS 6.0 PHP Asapi Module

justincouto asked
Medium Priority
Last Modified: 2012-05-04
I am about to loose my mind!  I have been trying to get PHP working as a module on IIS for about a week now.  Originally I was trying to get PHP5 RC1 working with IIS on Windows 2003 Server.  After following guide after guide, I kept running into the same problem.  I do everthing as listed in and answer to a similar question on this site:



I got the latest stable version of PHP running on Windows 2003 IIS6.0, without any problems.

* You first need to add a 'Web Service Extension' in through IIS manager, I called the extension PHP, and added the path to php4isapi.dll (don't forget to set the status to allowed)

* Then go to the properties of the website where you want to run PHP, select the 'Home Directory' tab, and click on the 'Configuration' button. Click 'Add', browse to the 'php4isapi.dll' file (put the path between quotes), type '.php' as the extension, and deselect 'Verify that the file exists'.

* copy the 'php4ts.dll' file from the php directory to the windows\system32 directory, and copy the php.ini-recommended file to the windows directory, and rename it to php.ini

*do a iisreset, and your php should work fine (without putting IIS in isolation mode)


Enrico Klein
Vertis BV


After pulling my hair out for a while, I decided to try it with PHP4 instead of the new 5 version.  After doing that I got the same problems as I has having with 5.  Here is my issue:

After folowing thew above instructions to a TEE, this is what happens.  I add my website and create a basic PHP script called index.php



When I try to access my script via my web browser, I get prompted to enter a username and password.  If I enter a machine username and password (ex.  Administrator, Password) it simply reprompts me to enter the password again.  It saves all the password infomration in the dialog box.  If I re-enter the username and password it continues to reprompt.  After three times it takes me to the no permissions page.  I don't think it is a permissions issue.  When I creat a static HTML file with the same permissions in the same directory it works fine.  If anyone could tell me what I am doing wrong I would really appreciate it.

Watch Question

Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

the site I mentioned on configuring PHP for IIS is the best I found, with nice screenshots.
I'm convinced you missed a configuration somewhere that's why you encounter those password prompts.
I encountered them myself. some how-to sites just don't mention everything and rely that you already now how to
do the rest of the process.

I wish to reword this:
"The IIS account may not have the appropriate execute
permissions for the directory on which the PHP page is located. The page
illustrates steps for doing so."

It's not the IIS account per se, it's the IIS configuration. There are are instances when
you do have to configure folder permissions for the IIS account. For example,
if you need to use sessions for your PHP, php.ini variable session.save_path
must point to a file on your machine where the session info would be saved and for
which IIS has the appropriate write permissions.


Ok, just got another idea =) ....
open the properties tab for the IIS website for which you want to configure PHP.
make sure that the dropdown list box labeled "Execute permissions" is set to "Scripts and Executables".

If that doesn't work or you already have done that, I recommend following the how to page
I pointed step by step.



I have some answers now.  I finally got PHP4 working somewhat.  I was initially trying to install PHP5 RC1 and I was getting the continous prompt for a username and password.  I am still having that problem with PHP5.  In an attempt to get this working now and not 10 years from now, I decided to go to PHP4.  After trying to install that I kept getting 404 errors which are consistent with other people on the web.  Their solution was to add a web service extention.  I did this and it didn't help.  What I finally realized is that the problem was that I was installing PHP into C:\Program files\PHP instead of C:\PHP.  I thought it wouldn't make a difference as long as my config was right.  However this isn't the case.  I guess the compiled version of PHP has to be installed in C:\PHP.  I guess the DLL's have some hard coded links in them or something.

OK, so I got php 4 working and I have my test PHP page working in my doc_root.  However I now need to be able to run php scripts from other directories.

I have a second hard drive E:

I have a directory on this drive called clients.  In this directory I have a directory for each client's site (client1, client2, etc).

I have a website setup pointing to E:\clients\client1.  In this directory I have a test php script.  
I have all the properties on this website the same as my default website that currently works.  However, when I try to acces the php script, the page starts to load and sits there and loads and loads and loads until it eventually times out.  I am now thinking this is a permissions issue.  However, as far as I know, the permissions are the same as they are on the default site.  If you think this is a permissions issue:

What do I need to do to fix it?

What permissions should the directory have?

What permissions should the files have?

Do all the parent directories need to have the same permissions as the directory that the files are in?

If this is not a permissions issue, please inform me of what to do to fix it?


OK I got it working now.  I was had added some modules in the php.ini that weren't working and this was making the page stall because php wasn't working right.  

I would still like to know why PHP5 won't work.  I would also like to know why you can't install php in C:\Progra~1\PHP

Other then that I am glad I got this working.

Thanks for all the help.

Glad to hear that everythings now working.
Regarding PHP5, I haven't installed that version yet.
I stuck with the last stable I found at the site, which was 4.3.4 (at least during the time I visited).
So I haven't encountered the problem you just described.

I'll see what I can find about this particular problem with PHP5. If this is really a bug then I believe we should
report it to php.org to have it fixed.



I am now having touble getting some of the modules working.  When I uncomment the curl module, it kills my PHP.  If that module is uncommented, and I go to a PHP page, it just loads forever until it times out.  Any ideas?


I am able to load some modules like the PDF module, the GD module, and the zip module.  However, if I try to load Curl or the XSLT module, i get the contious load problem.


I got it working.  I found this link:


All I needed to do to get the curl module working was copy the following files from the C:\php\dlls to the C:\Windows\system32


I'm not sure but maybe this would work:
add the path to c:\php\bin (or wherever your php the dlls are)
to the PATH environment variable so that windows will also look in that directory
when loading dlls.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.