Home > php教程 > php手册 > PHP无法上传大文件显示File couldn't be moved的解决方法

PHP无法上传大文件显示File couldn't be moved的解决方法

WBOY
Release: 2016-06-13 11:36:52
Original
856 people have browsed it

正在做一个文件上传共享网站,想通过以下代码实现文件上传功能:



Fill out the form to upload a file:

for ($i = 0; $i echo '

File:


Description:



';
}
?>





却发现上传稍微大一些的文件时,显示File couldn't be moved.但是数据库里显示文件名称,不显示大小。而上传大于8M的文件时,页面根本没有反应。上网搜了一下,在飞诺网找到一篇关于“PHP上传问题总结“的文章。文章指出了php的文件上传受到了php.ini以下设置的影响:

post_max_size
upload_max_filesize
max_execution_time
memory_limit

于是到 /etc/php5/apache2/ 下找到了php.ini,搜索post_max_size 将其默认值改为了125M,搜索upload_max_filesize将其默认值改为了125M,保存后。在终端输入:apache2ctl -k restart 重新启动apache,问题解决!可以在页面中随便上传大文件了~

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template