【问题标题】:wordpress blank page with nginx带有 nginx 的 wordpress 空白页
【发布时间】:2017-07-21 11:37:44
【问题描述】:

我在 centos 7 上将我的网络服务器 apache2 切换到 nginx,现在主 index.php 显示一个空白页面,但 wp-admin 工作正常。在 Web 控制台中,我可以看到 200 响应。我启用了 wp 调试但没有运气。这是我的主机文件

   server {
    root /var/www/html;
    index index.php index.html index.htm;
    server_name new-site.com;
     location = /favicon.ico {
     log_not_found off;
     }
    location / {
    try_files $uri $uri/ /index.php?$args;
    }
     location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
        }
    }

【问题讨论】:

    标签: php linux wordpress nginx


    【解决方案1】:

    这么多小时的谷歌搜索我得到了解决方案,这是我的工作配置将include fastcgi_params; 更改为 include fastcgi.conf;

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

    }

    【讨论】:

      【解决方案2】:

      这个网站适合我:new-staging.opploans.com 请尝试清理您的浏览器缓存,或者,如果您使用 cdn,请清除内容并重试。

      【讨论】:

      • 非常感谢。我得到了解决方案,现在它可以工作了我现在更改了配置并在我的答案中更新了解决方案
      猜你喜欢
      • 2017-12-30
      • 2017-06-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多