title: php won't include an existing file: permission denied
body: <p>You will laugh if you read to the end of this :) This is now driving me nuts - can't get php to include an existing file with proper permissions set etc.</p>
  
  <p>I have test.php file and "lib/tools.php" file.</p>
  
  <p>I run the following code:</p>
  
  <pre><code>$fn = 'C:\Sasha\ThreeDiamonds\www\lib\tools.php';
  if(file_exists($fn)){
      echo "Trying to INCLUDE THE BLoody file: $fn";
  if(require_once($fn)==false) echo("failed to include: ".$fn);
  }
  </code></pre>
  
  <p>and get the following:</p>
  
  <blockquote>
    <p>Trying to INCLUDE THE BLoody file:
    C:\Sasha\ThreeDiamonds\www\lib\tools.php
    Warning:
    require_once(C:\Sasha\ThreeDiamonds\www):
    failed to open stream: Permission
    denied in
    C:\Sasha\ThreeDiamonds\www\test.php on
    line 5 Fatal error: require_once():
    Failed opening required ''
    (include_path='.;C:\php5\pear') in
    C:\Sasha\ThreeDiamonds\www\test.php on
    line 5</p>
  </blockquote>
  
  <p>Now, this is running Windows/IIS and recent version of php. </p>
  
  <p>The following works fine if I call another php file from same with tools.php directory with the following code in it:</p>
  
  <pre><code>require('tools.php');
  $mytools = new tools();
  $mytools-&gt;ShowGallery();
  </code></pre>
  
  <p>This is driving me really mad :) IIS is setup to annon auth with app pool identity - I can see php-cgi.exe is running under Local Service account and I did make sure tools.php effective permissions allow full access for this account.</p>
  
  <p>I enabled security auditing for this tools.php file for failed attempts and it's not showing any issues.</p>
  
  <p>ok, I went ahead and installed ProcMon to see what's going on here. All I get is "FAST IO DISALLOWED" for "Query Open" operation. Mmmmm? Windows7 yeah.</p>
  
  <p>I'm lost, please help :)</p>