php+nginx 413 Request Entity Too Large 解决方法

最近在项目中上传文件的时候,上传出错,返回413 Request Entity Too Large

解决方法:

1. 以下代码加入 nginx.conf 文件中的 http{ ... } 块中

client_max_body_size 8M;  

2. PHP 设置上传大小 

打开php.ini 文件中 修改以下几个参数

memory_limit = 32M
 
upload_max_filesize = 8M
 
post_max_size = 16M
posted @ 2018-11-29 10:43  走步超人  阅读(1233)  评论(0编辑  收藏  举报