Share via


IIS 7 PHP Error: Failed to open stream: Permission denied

Question

Saturday, May 8, 2010 11:16 PM

I'm a PHP newbie and I'm getting the following error when viewing a form that I created in PHP.

PHP Warning:  require_once(C:\Sites\www\custom\templates): failed to open stream: Permission denied in C:\Sites\www\custom\templates\info_request.php on line 3
PHP Fatal error:  require_once(): Failed opening required '' (include_path='.;c:\php\includes') in C:\Sites\www\custom\templates\info_request.php on line 3

I'm on a Windows 2008 Server R1 (64bit) running IIS 7 and PHP through Fast CGI and MySQL server 5.1. Except for this issue PHP is running fine on the server. I'm running PHPMyAdmin and a couple other PHP apps just fine. I confirmed that I have permissions set correctly (have even run php files at the directory and file level under full control to test)

Appreciate any suggestions on how to troubleshoot this issue. Also, are you aware of any forums or community sites geared just for those running PHP under FastCG on IIS 7?

All replies (5)

Sunday, May 9, 2010 10:15 AM âś…Answered

Hi,

The error means that php-cgi.exe doesn't have appropriate permission. Please use process monitor and see which user is getting access denied for this process and give appropriate permission.

Thanks,

Don.


Sunday, May 9, 2010 1:17 PM

 I have the same problem - my login is the user.... should php-cgi.exe run on IUSR ?


Sunday, May 9, 2010 1:25 PM

See it all depends on credentials under which application pool is running. That credential should have proper permission.

Thanks,

Don.


Sunday, May 9, 2010 1:36 PM

 Sorry, if I understand you wrong - my English isn't well

 Where can i check those credentials ? I have only DefaultAppPool, where Identity is NetworkService (HTTP_AUTHORIZATION - NTLM)

 http://gfx.efotek.pl/images/l9z6uducbk4qyti396ed.png

 


Sunday, May 9, 2010 11:22 PM

Is your fastcgi.impersonate set to 1 in your php.ini file? Please use process monitor to see which user is getting access denied. Process monitor can be downloaded from http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx. Look for ACCESS DENIED error for executable php-cgi.exe.

Thanks,

Don.