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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 10:10:54
Original
923 people have browsed it

在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

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
Latest Issues
Can Windows be learned?
From 1970-01-01 08:00:00
0
0
0
Install PHP in windows environment
From 1970-01-01 08:00:00
0
0
0
zookeeper extension under windows
From 1970-01-01 08:00:00
0
0
0
Can I play vim happily on Windows?
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template