We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

IIS 7 PHP Error: Failed to open stream: Permission denied [Answered]RSS

5 replies

Last post May 09, 2010 11:22 PM by don.raman

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

    May 08, 2010 11:16 PM|Bittersweet|LINK

    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?

    IIS7 Windows 2008 Server php FastCG

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

    May 09, 2010 10:15 AM|don.raman|LINK

    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.

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

    May 09, 2010 01:17 PM|jastu|LINK

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

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

    May 09, 2010 01:25 PM|don.raman|LINK

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

    Thanks,

    Don.

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

    May 09, 2010 01:36 PM|jastu|LINK

     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

     

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

    May 09, 2010 11:22 PM|don.raman|LINK

    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.