wordpress 主题安装 您点击的链接已过期 nginx 出现413 Request Entity Too Large

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

访问媒体»添加 页面看到有大小限制的相关说明,如下图所示:
wordpresserro-768x234.jpg

尝试: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

原文地址:https://www.cnblogs.com/lqerio/p/12535879.html