看来我有些毛病nginx
关于如何在子目录中配置WordPress的文章中的配置。
Config Before
location @wp {
rewrite ^/blog(.*) /blog/index.php?q=$1;
}
location ^~ /blog {
root /home/user;
index index.php index.html index.htm;
try_files $uri $uri/ @wp;
location ~ \\.php$ {
include fastcgi_params;
fastcgi_index index.php;
fastcgi_intercept_errors on;
# Deleted this line
fastcgi_split_path_info ^(/blog)(/.*)$;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
}
break;
}
Config After
location @wp {
rewrite ^/blog(.*) /blog/index.php?q=$1;
}
location ^~ /blog {
root /home/user;
index index.php index.html index.htm;
try_files $uri $uri/ @wp;
location ~ \\.php$ {
include fastcgi_params;
# Added this line
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_index index.php;
fastcgi_intercept_errors on;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
}
break;
}
正如一些评论中提到的,由于nginx配置错误,导致加载时出现问题,因此一些PHP服务器变量设置不正确
/wp-admin/customize.php
如果您访问/wp-admin/customize.php?wp_customize=on
它开始工作,而不是抛出致命错误。