title: PHP - fopen(): failed to open stream: No such file or directory
body: <p>In my code I create a file called <code>$cookie</code>. I than later want to open it and read contents from it, but I get the error <code>fopen(): failed to open stream: No such file or directory.</code> I have a feeling I messed up something related to paths. Any advice on how to tackle this?</p>
  
  <p>I tried this:</p>
  
  <pre><code>&lt;?php
  $cookie = 'cookies3.txt';
  ..
  $myfile = fopen("cookies3.txt", "r") or die("Unable to open file!");
  echo fread($myfile,filesize("cookies3.txt"));
  fclose($myfile);
  </code></pre>