locked
IIS 7 PHP Error: Failed to open stream: Permission denied RRS feed

  • Question

  • User1248075058 posted
    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?
    Saturday, May 8, 2010 11:16 PM

Answers

  • User-1405480850 posted

    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.

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Sunday, May 9, 2010 10:15 AM

All replies

  • User-1405480850 posted

    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.

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Sunday, May 9, 2010 10:15 AM
  • User-1836919597 posted

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

    Sunday, May 9, 2010 1:17 PM
  • User-1405480850 posted

    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:25 PM
  • User-1836919597 posted

     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 1:36 PM
  • User-1405480850 posted

    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.

    Sunday, May 9, 2010 11:22 PM