簡述
在公司內部建置內部視訊學習網站,經過對比選擇了wordpress進行站點建置。但在上傳影片遭遇到了各種問題,特將此處理過程進行記錄。
原因檢查
1.上傳一個十幾兆mp4的檔案上傳進度到達百分之百,會媒體提示http錯誤

2.剛開始懷疑是PHP、Nginx的上傳大小限制了。但查看PHP、Nginx配置均配置了1000M
1 2 3 4 5 6 7 8 9 10 11 | vim /etc/nginx/conf.d/ default .conf
location / {
root /data/web;
index index.php index.html index.htm;
client_max_body_size 000M;
}
vim /etc/php.ini
upload_max_filesize = 000M
post_max_size = 000M
max_execution_time = 300
|
登入後複製
3.查看Nginx erro日誌
1 2 | tail / var /log/nginx/error.log
2018/02/14 09:32:07 [error] 87522#87522: *1 client intended to send too large body: 35016434 bytes, client: 36.111.88.33, server: localhost, request: "POST /wp-admin/async-upload.php HTTP/1.1" , host: "117.66.240.116:81" , referrer: "http://117.66.240.116:81/wp-admin/media-new.php"
|
登入後複製
只有下面這一行是最主要的保存資訊。以下錯誤就是body限制大小的問題
1 | client intended to send too large body
|
登入後複製
4.將限制大小的設定在http中後上串資源就不會在有限制
1 2 3 4 5 | vim /etc/nginx/nginx.conf
http{
client_max_body_size 1000M;
keepalive_timeout 300;
}
|
登入後複製
以上是如何處理WordPress上傳資源封包HTTP錯誤的詳細內容。更多資訊請關注PHP中文網其他相關文章!