My PHP script writes to a file so that it can create a jpg image.

```
fwrite($handle, $GLOBALS['HTTP_RAW_POST_DATA']);
fclose($handle);    
print $newfile.'.jpg';

```

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.

Firstly., Is there another fix? Secondly, If I could change the owner of the directory like last time will this fix the issue?

Thanks all for any help