开发者

Wordpress won't allow PHP errors

I have a site I am working on currently that uses Wordpress. However it makes it a bit difficult to debug because I cannot get PHP errors to display on the page. Instead I get the white screen of death.

I have tried adding the defines in the wp-config.php file and in the php.ini file to no avail. I also can't add the flags in the .hta开发者_如何学Goccess because of the way the server handles apache/php.

One thing I noticed is that any page outside of Wordpress displays errors fine.

Any suggestions?


Try adding ini_set("display_errors","2"); ERROR_REPORTING(E_ALL); to the index.php file.


Can you get access to /var/log/httpd/error_log? If you're on Linux, this is (by default) where the errors would be shown.


It is very useful for development WordPress installation set to true WP_DEBUG constant in wp-config.php file:

/**
* 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);

You will see much more, including PHP noticing and WordPress messages about deprecating staff usage.


on the .htaccess file in your root directory add the following line.

php_flag display_errors on
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜