0
我有一個php上傳到位於www(/ home/user/upload)上面的目錄中的文件夾。我製作了文件夾權限770,並創建了一個自定義組,其中包括用戶apache和nobody,以擁有它。PHP文件權限錯誤
當我做了chgrp命令mygrp上傳,PHP能夠上傳到它,但它確實一個時間後......這一切一下子不能寫或從中讀了...
有人有主意嗎?
==== ====編輯
這是我目前使用中的DL遠程文件的代碼:
$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);
我們可以看看您使用的是什麼代碼嗎? – 2011-07-02 21:06:48
getRandomString是什麼樣的?上面的代碼是否會拋出異常? – thetaiko
@Obto - 寫入失敗時會出現什麼錯誤? –