title: open_basedir won't let me write file, but directory seems correct?
body: <p>Short story:  </p>
  
  <p>I'm getting an open_basedir restriction in my php script - a simple "test writing a new file to disk" script. It SEEMS to me that I've got the open_basedir settings correct and the file is in the right location - but no luck, just the same error every time. I've searched for similar open_basedir problems on this site, but I've not seen any with this problem - where the directory looks right but it still throws errors.</p>
  
  <p>My guesses as to what the problem is:<br>
  1) open_basedir doesn't work the way I think it does<br>
  2) My settings are wrong and I'm just not seeing it<br>
  3) It's actually something else, like IIS read/write permissions, etc<br>
  4) ???  </p>
  
  <p>Long story:  </p>
  
  <p>I'm working on an IIS server with PHP and I'm trying to get the following code snippet to work (a simple write file test):  </p>
  
  <pre><code>date_default_timezone_set('America/Chicago');
  $myFile = 'testfile.txt';
  $fh = fopen($myFile, 'w') or die("can't open file");
  $stringData = "Some Text\n";
  fwrite($fh, $stringData);
  $stringData = "Some More Text\n";
  fwrite($fh, $stringData);
  fclose($fh);
  </code></pre>
  
  <p>This php script is located at C:\inetpub\wwwroot\WEBDIRECTORY\test_write.php on my server  </p>
  
  <p>Here is my php.ini setting for open_basedir:<br>
  open_basedir = c:\inetpub\wwwroot;c:\inetpub\wwwroot\WEBDIRECTORY  </p>
  
  <p>Whenever I open the script's page, I am expecting to see no output, and then there should be a new file written on the server when I check back. This is what I get instead:  </p>
  
  <blockquote>
    <p>Warning: fopen(): open_basedir
    restriction in effect.
    File(testfile.txt) is not within the
    allowed path(s): (c:\inetpub\wwwroot)
    in
    C:\inetpub\wwwroot\WEBDIRECTORY\test_write.php
    on line 5 Warning:
    fopen(testfile.txt): failed to open
    stream: Operation not permitted in
    C:\inetpub\wwwroot\WEBDIRECTORY\test_write.php
    on line 5 can't open file</p>
  </blockquote>
  
  <p>I've tried a lot of permutations: originally the open_basedir line was just<br>
  open_basedir = c:\inetpub\wwwroot</p>
  
  <p>...but that didn't work, either.  </p>
  
  <p>I've also tried entering an absolute path for testfile.txt (c:\inetpub\wwwroot\WEBDIRECTORY\testfile.txt, etc) instead of just the name of the file itself, and I keep getting the same error message.  </p>
  
  <p>Any ideas? Thanks so much for your help.</p>