define('WP_DEBUG',true);不显示错误 [英] define('WP_DEBUG', true); not show errors
本文介绍了define('WP_DEBUG',true);不显示错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在wp-config文件中启用了错误:
I enabled the errors in my wp-config file:
define('WP_DEBUG', true);
但这不起作用,Wordpress继续向我显示白色屏幕,没有任何信息的空白屏幕.
But this not work, Wordpress continues showing me a white screen, a blank screen with no information.
我该如何解决?
推荐答案
下面的代码(插入到wp-config.php文件中)会将所有错误,通知和警告记录到wp中名为debug.log的文件中-content目录.它还将隐藏错误,以便它们不会中断页面生成.
The below code, inserted in your wp-config.php file, will log all errors, notices, and warnings to a file called debug.log in the wp-content directory. It will also hide the errors so they do not interrupt page generation.
您必须在/*之前插入此代码,仅此而已,请停止编辑!祝您博客愉快. */在wp-config.php文件中.
// Enable WP_DEBUG mode
define('WP_DEBUG', true);
// Enable Debug logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);
// Disable display of errors and warnings
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);
// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define('SCRIPT_DEBUG', true);
来源: https://codex.wordpress.org/Debugging_in_WordPress
这篇关于define('WP_DEBUG',true);不显示错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文