nginx服务器上传失败
使用move_uploaded_file(),apache服务器就成功了,但nginx服务器上传失败,谁可以告诉我为什么呀?
<?php header("content-type:text/html;charset=utf-8"); if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 50000000)) { if ($_FILES["file"]["error"] > 0) { echo "出错啦: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br />"; echo "Type: " . $_FILES["file"]["type"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />"; echo "Stored in: " . $_FILES["file"]["tmp_name"]."<br />"; } if (file_exists("file/" . $_FILES["file"]["name"])){ echo $_FILES["file"]["name"] . " 此文件已存在. "; } else{ $s_path = '../file'; $result=move_uploaded_file($_FILES["file"]["tmp_name"], '$s_path/$_FILES["file"]["name"]'); if($result==true)echo "1"; else echo "0"; echo "储存目录: " . "//home/test/file/" . $_FILES["file"]["name"]; } $src = $_FILES["file"]["tmp_name"]; $dst = "//home/test/file/". $_FILES["file"]["name"]; if (!file_exists($src)) die(",临时文件不存在"); if (!is_readable($src)) die(",已上传但无法读取"); if (!is_writeable("//home/test/file/")) die(",无法写入"); } else { echo "我不同意你上传"; } ?>