nginx和php設定上傳大小及可以提交的內容限制

啊裡上海發表於2017-08-24

1. 以下程式碼加入 /etc/nginx/nginx.conf 檔案中的 http{ … } 塊中

client_max_body_size 8M;

2. PHP 設定上傳大小

開啟 /etc/php5/fpm/php.ini 檔案中 修改以下幾個引數

;This sets the maximum amount of memory in bytes that a script is allowed to allocate
memory_limit = 32M
 
;The maximum size of an uploaded file.
upload_max_filesize = 8M
 
;Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize
post_max_size = 16M

 

學習交流群:364976091


相關文章