I have a folder which php uploads to located in the directory above www (/home/user/upload). I have made the folders permissions 770 and made a custom group, which includes user apache and nobody, to own it.
When I do a chgrp mygrp upload, php is able to upload to it, but after it does one time… it all of a sudden can’t write or read from it anymore…
Anyone have any ideas?
====EDIT====
Here is the code I’m currently using to dl a remote file:
$ch = curl_init($url);
$image = TMP_DIR.'/'.getRandomString(10).".{$info->extension}";
while (file_exists($image))
$image = TMP_DIR.'/'.getRandomString(10).".{$info->extension}";
$image_handle = fopen($image, 'w');
curl_setopt($ch, CURLOPT_FILE, $image_handle);
if (curl_exec($ch) === false)
throw new Exception('Curl error: '.curl_error($ch), curl_errno($ch));
curl_close($ch);
Well i feel a bit stupid now… after adding and changing users and groups I never restarted php or apache. So if anyone else ever has this problem make sure you do that first.
Thanks for your time and help guys!