Home  >  Article  >  Backend Development  >  linux环境 上传资料失败 tmp_name为空

linux环境 上传资料失败 tmp_name为空

WBOY
WBOYOriginal
2016-06-13 12:40:241025browse

linux环境 上传文件失败 tmp_name为空
phpinfo显示的信息如下
file_uploads On
upload_max_filesize 2M
upload_tmp_dir /Users/ririn/Sites/tmp
然后 我对 这个目录设置了777权限 chmod 777 /Users/ririn/Sites/tmp   是不是还有什么需要设置的地方?
但是上传文件 还是不行啊 
首先tmp目录中就没有任何文件
当然后台用$tmp=$_FILES['mypic']['tmp_name']; 这个也无法得到...

在win中是可以正常运行的  win中的配置和这里的一样 我选的文件也只有100多k  

还是贴一下我的代码 是不是linux的要加上一点什么


                File1: 

                upimg

                
                
            



$tmp=$_FILES['mypic']['tmp_name'];    //空的  
$name=$_FILES['mypic']['name'];
$size=$_FILES['mypic']['size'];
$arr =array(
    'tmp'=>$tmp,
    'name'=>$name,
    'size'=>$size
    );
var_dump($arr);

?>
最后打印的是  array(3) { ["tmp"]=> string(0) "" ["name"]=> string(9) "scoot.png" ["size"]=> int(0) } 这样的
win中完全正常 
Linux 上传 权限
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn