Home >php教程 >php手册 >windows/linux中PHP文件上传大小修改

windows/linux中PHP文件上传大小修改

WBOY
WBOYOriginal
2016-06-13 10:10:54879browse

在php中默认只能上传2MB大小的文件,如果想上传更多更大的文件我们需要修改一些参数,下面大家来参考一下。

linux系统

1、/usr/local/nginx/conf/nginx.conf
修改

client_max_body_size

2、/usr/local/php/etc/php.ini

修改

post_max_size
upload_max_filesize

3、重启LNMP /root/lnmp restart

windows系统

php默认的post_max_size 为2M.如果 POST 数据尺寸大于 post_max_size $_POST 和 $_FILES superglobals 便会为空.
查找

post_max_size .

改为
post_max_size = 150M

查找upload_max_filesize,默认为8M改为

upload_max_filesize = 100M

另外要说明的是,post_max_size 大于 upload_max_filesize 为佳.

总结

其实就是修改php.ini中的三个参数

upload_max_filesize = 8M
post_max_size = 10M
memory_limit = 20M

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