title: PHP: fopen: No such file or directory
body: <p>I am trying to create write a log file for my web site. To do this I use the following code to try and open the file. Now the file does not exist yet, but the documentation states that adding "a+" flag ensures that the file is created if it does not exist. </p>
  
  <pre><code> $file = fopen($_SERVER['DOCUMENT_ROOT']."/logs/mylogfile.txt", "a+");
  </code></pre>
  
  <p>The above code gives me the following error...</p>
  
  <pre><code>Warning: fopen(E:/wamp/www/logs/mylogfile.txt) [function.fopen]: failed to open stream: No such file or directory
  </code></pre>
  
  <p>What am I doing wrong ? Please excuse me if this is stupid question, I am very new to PHP. </p>