服务器文件上传大小限制调整(centos nginx php)

Posted by 昆山吴彦祖 on 2018.04.27

1、修改nginx文件上传大小限制

vim /etc/nginx/nginx.conf

在http段里面添加/修改: 

client_max_body_size 100m;

2、修改php文件上传大小限制 

vim /etc/php.ini
file_uploads = on ;
upload_max_filesize = 100m ;
post_max_size = 100m ;

max_execution_time = 600 ;
max_input_time = 600 ;
memory_limit = 100m ;

3、重启服务 

systemctl restart nginx
systemctl restart php-fpm

#如果重启完这2个服务设置还没生效,直接重启主机
shutdown -r now