Home > Backend Development > PHP Tutorial > linux Warning: move_uploaded_file() 有权限 存在目录 神级般的有关问题

linux Warning: move_uploaded_file() 有权限 存在目录 神级般的有关问题

WBOY
Release: 2016-06-13 10:52:37
Original
1413 people have browsed it

linux Warning: move_uploaded_file() 有权限 存在目录 神级般的问题
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpD8hOF1' to 'icon/1349459701.jpg' in /download/soft/admin/zhfzhf/upload_file/upload_table.php on line 221

就这一个错误,只可以移动到lamp里htdocs的目录(这个的权限是755)下,出了那个目录就不行了。。外面的目录权限是777,文件可以在‘icon/’里面看到,但是大小为0。。求助


------解决方案--------------------
安全模式下?
------解决方案--------------------
問題很明显啊
Unable to move '/tmp/phpD8hOF1' to 'icon/1349459701.jpg'
无法从/tmp/phpD8hOF1移到icon/1349459701.jpg
那么请问/tmp/phpD8hOF1的权限值是多少呢?
------解决方案--------------------

探讨

問題很明显啊
Unable to move '/tmp/phpD8hOF1' to 'icon/1349459701.jpg'
无法从/tmp/phpD8hOF1移到icon/1349459701.jpg
那么请问/tmp/phpD8hOF1的权限值是多少呢?

------解决方案--------------------
open_basedir 在php.ini里是不是做了限制?
------解决方案--------------------
把 move_uploaded_file 换成 copy 看看
注意 copy 不能对已存在的文件操作,请先删去已存在的文件
------解决方案--------------------
if (is_uploaded_file($files['tmp_name'])) {
if (@move_uploaded_file($files['tmp_name'], $destination)) {
@chmod($destination,0644);
}
}

我遇过类似的问题,在某虚拟空间上,需要对$destination chmod

确实有点奇怪……
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template