为什么wordpress主页是空白的

时间:2016-11-18 09:30:31

标签: php wordpress nginx

这是我的nginx.conf,我运行followng shell来启动wordpress

sudo nginx -g 'daemon off;' -c /home/roroco/Dropbox/rbs/ro_wp/conf/nginx.wp.conf

我可以获得200个ok响应,但是主页是空白的,就像下面一样,我的nginx错误日志没有错误

enter image description here

更新

这是我的wp-config,我只下载最新的wordpress并且只更改此文件

1 个答案:

答案 0 :(得分:0)

我找到了解决方案:

我的旧nginx.conf就像:

...
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# sock file can be found in /etc/php/7.0/fpm/pool.d/www.conf
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
}
...

正确的nginx.conf是

location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        # sock file can be found in /etc/php/7.0/fpm/pool.d/www.conf
        include /etc/nginx/fastcgi_params;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $request_filename;
}