title: PHP - fopen log_post.txt failed to open stream: no such file or directory
body: <blockquote>
    <p>Warning: fopen(log_post.txt): failed to open stream: No such file or directory in C:\xampp\htdocs\MyApp\public\index.php on line 3
    can't open file</p>
  </blockquote>
  
  <p>My <code>index.php</code> in the public folder:</p>
  
  <pre><code>&lt;?php
  $File = "log_post.txt"; 
  $fh = fopen($File, 't') or die("can't open file"); 
  fwrite($fh, "\n"); 
  #$headers = apache_request_headers(); 
  #foreach ($headers as $h =&gt; $v)
  #   fwrite($fh, "$h: $v\n");
  #fwrite($fh, print_r($HTTP_RAW_POST_DATA,1));
  fclose($fh);
  require_once 'Framework/SiteHandler.php';
  
  Zend_Controller_Front::getInstance()
      -&gt;setControllerDirectory('../application/controllers')
      -&gt;throwExceptions(false)
      -&gt;dispatch();
  ?&gt;
  </code></pre>
  
  <p>How should i fix that?</p>