2011-07-09 35 views
4

我有一个网站,我目前正在使用Wordpress。但是,它使调试有点困难,因为我无法在页面上显示PHP错误。相反,我得到了死亡的白色屏幕。Wordpress不会允许PHP错误

我已经尝试在wp-config.php文件和php.ini文件中添加定义无济于事。由于服务器处理apache/php的方式,我也不能在.htaccess中添加标志。

我发现的一件事是,Wordpress以外的任何页面都显示错误。

有什么建议吗?

回答

2

您可以访问/ var/log/httpd/error_log吗?如果你在Linux上,这是(默认情况下)错误将被显示。

+0

它托管(私人),所以我无法访问/ var。谢谢 –

+0

好的,错误插件怎么样? http://wordpress.org/extend/plugins/error-reporting/ –

+0

请检查您的安装的根目录是否为error_log文件或导致错误的插件的根目录。某些服务器是以这种方式配置的。 –

6

尝试将ini_set("display_errors","2");ERROR_REPORTING(E_ALL);添加到index.php文件中。

+0

谢谢我试过这个,但没有运气。 –

1

在您的根目录中的.htaccess文件中添加以下行。

php_flag display_errors on 
+0

这会导致内部服务器错误 –

1

这是发展的WordPress安装在wp-config.php文件设置为true WP_DEBUG常数非常有用:

/** 
* For developers: WordPress debugging mode. 
* 
* Change this to true to enable the display of notices during development. 
* It is strongly recommended that plugin and theme developers use WP_DEBUG 
* in their development environments. 
*/ 

define('WP_DEBUG', true); 

你会看到更多的,包括有关自嘲人员注意到PHP和WordPress的消息用法。

+0

这是我们尝试的第一件事情之一。谢谢你。我在想事情有冲突。 –