1、修改你的web站对应nginx的配置文件,把 client_max_body_size 的值设置为你想设置的值。比如:

1
2
3
4
5
6
7
8
9
10
11
server {
listen 80;
server_name app.com;
client_max_body_size 25m;
access_log /var/log/nginx/app.access.log main;
location / {
root /var/app;
index index.html index.htm index.php;
}
...
}

2、修改php.ini

1
2
3
4
5
6
7
upload_max_filesize = 30M 
post_max_size = 20M
memory_limit = 30M
max_execution_time=300
file_uploads = On
默认允许HTTP文件上传,此选项不能设置为OFF。
upload_tmp_dir =/tmp/www