php 在 Wordpress 博客上获取空白页面

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15493629/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 09:20:52  来源:igfitidea点击:

Getting a blank page on Wordpress blog

phpwordpressnginx

提问by Saad

I have a Wordpress blog which was working fine until I updated my PHP 5.3 to 5.5. Now the whole blog is blank. I cannot view the admin page or even the log in page. I have tried to fix it after searching a lot on Google, but it is still not working.

我有一个 Wordpress 博客,它运行良好,直到我将 PHP 5.3 更新到 5.5。现在整个博客都是空白的。我无法查看管理页面甚至登录页面。我在谷歌上搜索了很多后试图修复它,但它仍然无法正常工作。

I have gone through these solutions:

我经历了这些解决方案:

As stated in these solution the main reason is either a faulty theme or a plugin. So I changed my plugin folder to plugins_temp but still got that blank page. Then I changed my themes folder to themes_temp and still I got that same problem.

正如这些解决方案中所述,主要原因是主题错误或插件。所以我将我的插件文件夹更改为 plugins_temp 但仍然有那个空白页。然后我将我的主题文件夹更改为 themes_temp,但我仍然遇到同样的问题。

In the first link that I have submitted here there was this solution # 3 Warning: Cannot modify Header informationwhere they proposed a solution i.e wp-config.php will have a blank line after the php '?>' closing tag. I looked at my wp-config.php and there was no closing tag '?>'. So I added that tag without a blank line and that still didn't solve that blank page issue.

在我在这里提交的第一个链接中# 3 Warning: Cannot modify Header information,他们提出了一个解决方案,即 wp-config.php 在 php '?>' 结束标记后会有一个空行。我查看了我的 wp-config.php 并且没有结束标记“?>”。所以我添加了没有空行的标签,但仍然没有解决空白页问题。

I have another PHP website on a different subdomain and it is working fine. In my blog's root folder there is readme.html and when I use this url (myblog/readme.html) then that file gets displayed on the browser so only none of the PHP files are getting rendered.

我在不同的子域上有另一个 PHP 网站,它运行良好。在我博客的根文件夹中有 readme.html,当我使用这个 url (myblog/readme.html) 时,该文件会显示在浏览器上,因此只有没有任何 PHP 文件被呈现。

Lastly I did try to install a totally fresh Wordpress site but when I go to install.php then none of the files are being executed.

最后,我确实尝试安装一个全新的 Wordpress 站点,但是当我转到 install.php 时,没有任何文件正在执行。

I am using php5-fpm, Ubuntu 12.04 and NginX.

我正在使用 php5-fpm、Ubuntu 12.04 和 NginX。

回答by user850010

Did you try turning on debugging mode?

您是否尝试打开调试模式?

You do that in wp-config.php.

你在wp-config.php 中做到这一点。

Locate define('WP_DEBUG', false);and set it to true.

找到define('WP_DEBUG', false);并将其设置为 true。

Another thing I would try is to make some simple php file and test that if it is working. Something like:

我会尝试的另一件事是制作一些简单的 php 文件并测试它是否有效。就像是:

<?php

echo "test";

?>

UPDATE:

更新:

Since you probably have problem with php itself, check this question on stackoverflow php not working with nginx on ubuntu:

由于您可能对 php 本身有问题,请检查 stackoverflow php not working with nginx on ubuntu上的这个问题:

回答by thedjaney

Some common solutions

一些常见的解决方案

  1. define('WP_DEBUG', false); set to TRUE- wordpress turns off the error reporting, thats why you get white screens. Turning this on would show the error messages.
  2. error_reporting(E_ALL); ini_set('display_errors', '1');- if solution above doesnt work, you can manually add this in your wp-config or to the template file that broke down.
  3. if everything else fails, then you can try tracing the code with something like, die('runs till here'). It's a pretty back breaking method but it will surely point you where problem is. I did this once and found out later that the white screen was caused by a memory limit exceedederror. This kind of error can't be seen with solution 1 & 2.
  1. 定义('WP_DEBUG',假);设置为 TRUE- wordpress 关闭错误报告,这就是为什么你会看到白屏。打开它会显示错误消息。
  2. 错误报告(E_ALL);ini_set('display_errors', '1'); - 如果上述解决方案不起作用,您可以手动将其添加到 wp-config 或出现故障的模板文件中。
  3. 如果其他一切都失败了,那么您可以尝试使用诸如die('runs until here') 之类的内容来跟踪代码。这是一种非常令人费解的方法,但它肯定会指出问题所在。我做过一次,后来发现白屏是由于内存限制超出错误引起的。解决方案 1 和 2 看不到这种错误。

回答by Borniet

Check your errorlog, most probably one of the installed plugins isn't compatible with PHP 5.5 Try to find out which one, and disable it via the wordpress database or the filesystem: http://www.ostraining.com/blog/wordpress/disable-a-wordpress-plugin/

检查您的错误日志,很可能已安装的插件之一与 PHP 5.5 不兼容尝试找出哪个插件,并通过 wordpress 数据库或文件系统禁用它:http: //www.ostraining.com/blog/wordpress/禁用-a-wordpress-plugin/