1
nginx 出現413 Request Entity Too Large
問題是限制上傳大小,解決:
1.打開nginx配置文件 nginx.conf, 路徑一般是:/etc/nginx/nginx.conf。
2.在http{}段中加入 client_max_body_size 20m; 20m為允許最大上傳的大小。
3.保存后重啟nginx,service nginx restart
2 wordpress 主題安裝 您點擊的鏈接已過期
在解決413問題后再上傳zip主題安裝包還是失敗。
The link you followed has expired
訪問媒體»添加 頁面看到有大小限制的相關說明,如下圖所示:
嘗試:1
通過php.ini文件修復
php.ini文件是PHP和WordPress使用的配置文件。大多數用戶都在共享主機帳戶上,因此他們可能無法在其站點的根文件夾中找到它。
現在編輯php.ini文件並在其中添加以下代碼。
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
失敗。
再看這個文件發現不是添加,是修改。在文件頂部添加這個代碼后再文件下面又修改了
注意修改完成后 service php-fpm restart
同時修改 nignx配置文件(nginx.conf)中的client_max_body_size
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
client_max_body_size 64m; # bodysize
重啟nginx
service nginx restart
在vim中查找關鍵字
命令模式下 /keyword