title: Write to Directory using PHP: Is this a permissions problem?
body: <p>My PHP script writes to a file so that it can create a jpg image.</p>
  
  <pre><code>fwrite($handle, $GLOBALS['HTTP_RAW_POST_DATA']);
  fclose($handle);    
  print $newfile.'.jpg';
  </code></pre>
  
  <p>I have put this script on a new server however the image never gets saved. The permission of the folder it saves to is 755 but it does not own it. Last time, I think I fixed the issue by changing the directory owner to apache as this is what PHP runs as. I can not do the same again because I am not root.</p>
  
  <p>Firstly., Is there another fix? Secondly, If I could change the owner of the directory like last time will this fix the issue?</p>
  
  <p>Thanks all for any help</p>