0
我有一個PHP腳本,我用它來上傳。在我切換到另一臺服務器之前,現在沒有。這是PHP文件:失敗的上傳腳本
<?php
if($_FILES["file"]["error"] > 0){
echo "There was an error processing your upload. Please try again. ";
}else{
// Save this file in the directory
move_uploaded_file('$_FILES["file"]["tmp_name"]', '"uploads/".$_FILES["file"]["name"]');
}
?>
在error.log中,我不僅收到此錯誤:
[Sun Jul 21 12:32:34 2013] [error] [client 10.127.2.10] PHP Warning:
move_uploaded_file(uploads/file.
txt): failed to open stream: Permission denied in /home/liongold/Web/upload_script.php on line 6, referer
: http://url/upload_page.html
[Sun Jul 21 12:32:34 2013] [error] [client 10.127.2.10] PHP Warning: move_uploaded_file(): Unable to mov
e '/tmp/phpa0hsMc' to 'uploads/file.txt' in /home/liongold/Web/upload_script.php on line 6, referer: h
ttp://url/upload_page.html
我想'755'就夠了嗎? – bystwn22
是的755也夠了。 –