views:

260

answers:

3
+2  Q: 

Php on IIS6

I'm getting 401.1 errors when trying to run a .php file on windows 2003/IIS6 I've been all over the web, given Everyone Full perms on the folder containing the file as well as the file... Nothing.

What am I missing?

+2  A: 

Here's a step-by-step guide for getting PHP running on IIS 6.

Matt in PA
That got me up .2 an error point.Now: HTTP Error 401.3 - Unauthorized: Access is denied due to an ACL set on the requested resource.
Gene R
See if this helps...http://blog.stephenrushing.com/index.php/php/php-and-mysql-on-iis6/
Matt in PA
Thanks, I have tried all of these, nothing seemed to work. Not even a reboot.
Gene R
A: 
  1. can you serve HTML in the folder trying to serve PHP?

  2. If yes, what are the permissions on the PHP directory and PHP DLL (e.g. php5isapi.dll)? The IUSR will need execute.

matt.mercieca
1. Yes, I am able to serve HTMl and ColdFusion, just not PHP2. When you say PHP directory, do you mean C:\PHP? and the php5isapi.dll in the windows/system32 dir?
Gene R
Yes, that's what I meant by the DLL. Where the DLL lives varies by installation, so it could be in either C:\PHP or system32. I'd try adding read/execute on the DLL first, test, and then on the C:\PHP directory if that doesn't work.
matt.mercieca
Tried both of these, to no avail.
Gene R
Odd. Did you try this in locally in IE?
matt.mercieca
Another thing to check, in the Application Configuration in IIS, check that the IUSR has read and execute permissions on the DLL .php is mapped to and that it allows the GET and POST verbs.
matt.mercieca
Yep, all of these things are true. I'm officially stumped, have tried everything everyone has offered. Not sure whats next...
Gene R
Did you try just giving IUSR permissions or Network Service too? Also, what are the permissions on the php.ini--- might as well add all DLLs with PHP in the title.I've got to believe that you're close.
matt.mercieca
I gave the entire C:\PHP directory full access to the IUSR account. Could it have anything to do with the PHP dir being on C and my wwwroot being on D:\ ?
Gene R
Your wwwroot can be on a different drive, that shouldn't matter. PHP may be running under the Network Service account. You can check by right clicking on the app pool and going to the identity tab. Also your PHP.ini may be in /windows/system32 so not covered by the C:\php permissions.
matt.mercieca
I double checked /system32/php.ini and gave the IUSR write perms. Restarted IIS. I went into the App Pools/Identity tab and it was in fact using the Network Service. I tried all other options (Local Service, Local System and Configurable/IWAM). Restarted IIS after all changes. Same error. AAAH!
Gene R
In the app pool identity tab, you can select the Configurable radio button browse to the IUSR (you will need to know the IUSR password). Or you can give Network Service read and execute on the PHP dlls and directory. I'd set it to Network Service and add those permissions first, personally.
matt.mercieca
UG, I did all that, the c:\php folder, and all php*.* files in system32. Set the Network Service to read/execute. Restarted IIS. NADA!
Gene R
Although none of these really helped, you did more to help me understand than anyone else. The final result was a complete un-re install. But it works now, so...
Gene R
I'm glad you finally sorted it out. No one likes the reinstall solution, but I'm happy that it worked.
matt.mercieca
A: 

Take a look at the logs produced by IIS (found somwhere in C:\WINDOWS\system32\LogFiles\W3SVC1) this might give you some additional info.

Drejc
Um, the last modified date on any log in the w3svc1 file is 3/28/2005. Is there something I need to turn on as far as logging?
Gene R
No ... it should be there ... it's just a simple GET, POST list of requests. Try making a request to some other (not PHP) site hosted on your IIS and see if the log is there.
Drejc