我的問題是設置權限var/www這似乎是不可能me.so這是一個有關ubuntu的問題,因爲我發現許多其他人在ubuntu面臨同樣的問題。無法通過php腳本將文件上傳到我的Ubuntu服務器
這裏是我的腳本
<?php
ini_set("display_errors","on");
if(isset($_POST['submit'])){
echo "submitted<br>";
$file_name = $_POST['fname'];
$uploader_name = $_POST['uname'];
if(!empty($_POST['description'])){
$description = $_POST['description'];
}
else{
$description="";
}
if(isset($_FILES['upload'])){
echo 'success';
move_uploaded_file($_FILES['upload']['tmp_name'], "security/{$_FILES['upload']['name']}");
}
else
{
echo 'file not uploaded';
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>upload</title>
</head>
<body>
<form action='upload.php' method='post'>
<strong style="color:red;display: inline-block;width: 180px">Name of File:*</strong>
<input type="text" name="fname" size="50" maxlength="100" required=""><br><br>
<strong style="color:red;display: inline-block;width: 180px">Name of Uploader:*</strong>
<input type="text" name="uname" size='50' maxlength="100" required=""><br><br>
<strong style="color:red;display: inline-block;width: 180px ">Description(optional)</strong><br><br>
<textarea rows="20" cols="100"></textarea><br><br>
<input type="file" name="upload" required=""><br><br>
<input type="submit" name="submit" value="Upload">
</form>
</body>
</html>
我什麼都試過了我就問Ubuntu的,堆棧溢出和Ubuntu論壇,即搭配chmod和chown發現。
PS:這個問題是從askubuntu.Please移動幫助
謝謝先生。我開着自己crazy.i認爲這是一件與權限 –
歡迎請把它標記爲通過點擊蜱答案...:) –