1. 程式人生 > >POST Content-Length of 65077906 bytes exceeds the limit of 52428800 bytes in Unknown on line 0

POST Content-Length of 65077906 bytes exceeds the limit of 52428800 bytes in Unknown on line 0

PHP上傳時,當上傳檔案大小超過php.ini中配置閾值時,會出現上面警告,從$_FILES中無法取到上傳的檔案資訊。

解決辦法
① 開啟php.ini,修改如下兩行:

# 上傳檔案的最大值
upload_max_filesize = 100M

# post提交時最大資料大小
post_max_size = 100M

② 重啟web伺服器(apache或者nginx)

同時需要注意web伺服器對提交資料大小的限制,如nginx,當超過限制時,會報如下錯誤:client intended to send too large body
解決辦法
① 修改nginx.conf

client_max_body_size 100m;

② 重新nginx