title: php fopen function not working through linked script
body: <p>Hi I have created a php that creates a file in php using fopen it works fine by itself but when I access it through another php script it fails to create the file.
  I tried <code>sudo chown -R root /directory</code> on the directory but it doesn't work and <code>sudo chcon -R -t httpd_sys_script_rw_t /directory</code>, but still to no avail.</p>
  
  <pre><code>&lt;?php
      $my_file    = '../file.js';
      $handle     = fopen($my_file, 'w') or die('Cannot open file:  '.$my_file);
  
      //check if the file exists
      if (file_exists('../file.js')){
          echo "file exists &lt;br /&gt;";
      }
  ?&gt;
  </code></pre>