title: Get meaningful information when fopen() fails (PHP/suPHP)
body: <p>How do I get something more meaningful than 'FALSE' when I can't open a file. </p>
  
  <pre><code>$myFile = "/home/user/testFile.txt"; 
  $fh = fopen($myFile, 'w') or die("can't open file");
  </code></pre>
  
  <p>When I use the <code>die</code> statement, <code>can't open file</code> is returned to the client, and it is almost useless. If I remove it, no error is raised. If I return <code>$fh</code> it is <code>FALSE</code>. I tried both local file name and absolute file name. My <code>index.html</code> file is in one of the sub folders of my hole folder. Furthermore, I am using suPHP with the folder I am trying to write to having a permission of <code>0755</code> (suPHP requires this for all folders).</p>
  
  <p>How do I figure out why there was a problem, or at least query it before trying to open the file.</p>