Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

Need help understanding PHP permissions issue on IIS 7.5

$
0
0

I'm developing an application using WebMatrix 2.0 and php_cgi.exe (IIS Express\PHP\v5.3) running on Windows 7 Enterprise.

The application is supposed to write to a log file in the base directory.  When I run the application under WebMatrix (URL-http://localhost:22458) this all works ok.  However, if I try to run this directly from the URLhttp://localhost/MyPHPApp/index.php. The application runs correctly but the log file is not updated.

I used Process Monitor to watch php_cgi.exe and found that I'm getting an ACCESS DENIED error for the log file.  The process is impersonating NT AUTHORITY\IUSR.

I checked permissions on c:\inet\wwwroot\MyPHPApp folder and set the Security permissions for IIS_IUSRS group to Full (after trying modify and write).  This has not corrected the problem.

I looked at MyPHPApp's configuration and its Anonymous user identity is set to IUSR (as you would expect).

Can anyone provide me with more clues to what may be going on here.  I've searched and tried just about everything (most of which involved setting permissions).

I don't understand why the WebMatrix run works and the direct run doesn't. They are operating from the same folders. IIS Manager shows  MyPHPApp folder under the Default Web Site.

As I said, the php script seems to be doing what it is supposed to do in both cases except that the direct run (http://localhost/MyPHPApp/index.php) does not write the log file and gets the permission error (from the php log "PHP Warning:  fopen(Deployment.log): failed to open stream: Permission denied in C:\inetpub\wwwroot\MyPHPApp\index.php on line 12")

The php script line to open the log file is simply:

$logfile=fopen("Deployment.log","a");

Richard


Viewing all articles
Browse latest Browse all 27852

Trending Articles