dongzichan2886 2018-08-03 06:48
浏览 167

NGINX上的Wordpress打开白页:(

I developed some wordpress site on windows and there it worked fine without any problems. Now I need to migrate to Ubuntu 18.04 Server with Nginx and PHP 7.2 at board.

I do all by manuals, but any wordpress page are opens as blank white page :( I tested it by adding to main folder phpinfo.php with phpinfo(); code and it opens without problems as domain/phpinfo.php, images and html files are also opens without problems as domain/image.png or domain/file.html.

The most awful thing is that I didn't get any errors :(

Here are my domain config:

 map $uri $blogname{
~^(?P<blogpath>/[^/]+/)files/(.*)       $blogpath ; }

map $blogname $blogid{
default -999;

#Ref: http://wordpress.org/extend/plugins/nginx-helper/
#include /var/www/wordpress/wp-content/plugins/nginx-helper/map.conf ; }

server {
server_name domain;

root /srv/domain;
index index.php;
access_log /var/log/nginx/domain.access.log;
error_log /var/log/nginx/domain.error.log;

location ~ ^(/[^/]+/)?files/(.+) {
    try_files /wp-content/blogs.dir/$blogid/files/$2 /wp-includes/ms-files.php?file=$2 ;
    access_log off;     log_not_found off; expires max;
}

#avoid php readfile()
location ^~ /blogs.dir {
    internal;
    alias /srv/domain/htdocs/wp-content/blogs.dir ;
    access_log off;     log_not_found off; expires max;
}

if (!-e $request_filename) {
    rewrite /wp-admin$ $scheme://$host$uri/ permanent;
    rewrite ^(/[^/]+)?(/wp-.*) $2 last;
    rewrite ^(/[^/]+)?(/.*\.php) $2 last;
}

location / {
    try_files $uri $uri/ /index.php?$args ;
}

location ~ \.php$ {     fastcgi_split_path_info ^(.+\.php)(/.+)$;   fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
    try_files $uri =404;    fastcgi_index index.php;    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi.conf;
}

#add some rules for static content expiry-headers here }

Here are my nginx.conf file:

user www-data; worker_processes auto; pid /run/nginx.pid; include /etc/nginx/modules-enabled/*.conf;

events {    worker_connections 768; }

http {


ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE  ssl_prefer_server_ciphers on;

access_log /var/log/nginx/access.log;   error_log /var/log/nginx/error.log;

gzip on;

include /etc/nginx/conf.d/*.conf;   include /etc/nginx/sites-enabled/*; }

Thanks in advance

  • 写回答

2条回答 默认 最新

  • donglan7594 2018-08-03 07:01
    关注

    Since phpinfo() and html pages are working. It could be the WordPress White Screen of Death (WSOD) issue.

    • The WP_DEBUG feature often provides additional information.

    May I know if you are able to access the wp-admin area?

    https://www.domain/wp-admin
    

    If yes, then try the following:

    • A Plugin is causing compatibility issues. If you can access the Administration Screens try deactivating all of your Plugins and then reactivating them one by one. If you are unable to access your Screens, log in to your website via FTP. Locate the folder wp-content/plugins and rename the Plugin folder plugins_old. This will deactivate all of your Plugins. You can read more about manually deactivating your plugins in the Troubleshooting FAQ.
    • Your Theme may be causing the problem. This is especially likely if you are experiencing the white screen of death after you have just activated a new Theme, or created a New Site in a WordPress Network. Log in to the Administration Screens and activate the default WordPress Twenty Sixteen Theme. If you can't access your Administration Screens, access your website via FTP and navigate to the /wp-content/themes/ folder. Rename the folder for the active Theme.
    • Your Theme directory may be missing or renamed. This is common for developers who have just created a local development environment and cloned the database, which is pointing to a theme (or theme directory) that might be missing or renamed. To test this solution, try accessing wp-login.php or /wp-admin/. If you see anything, this is a good indication it's theme-related. Log in as an administrator, then try to view the front-end and you should see a WordPress error message to the effect of: The theme directory "{theme-name}" does not exist. You can solve this in any n umber of ways, including switching themes on the admin side, renaming your directory, or editing the "theme" and "stylesheet" records in wp_options

    Source: https://codex.wordpress.org/Common_WordPress_Errors

    Thank you!

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?