WordPress手动开启WP错误调试

打开在 wp-config.php 文件,添加以下代码(注意如果原配置文件中有define('WP_DEBUG', true);等代码,请把它们注释掉):

/**
 * This will log all errors notices and warnings to a file called debug.log in
 * wp-content (if Apache does not have write permission, you may need to create
 * the file first and set the appropriate permissions) 
 */
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);
保存后,你就可以在 wp-content/debug.log 文件中看到相应的错误信息了。如果你想直接显示错误信息在网页上,替换成:

/ 开启WP_DEBUG模式
define( 'WP_DEBUG', true );
 
// 开启DEBUG日志,一定要记得关闭这个日志功能并清理这个日志文件哦,产生的日志文件在: /wp-content/debug.log
define( 'WP_DEBUG_LOG', true );
 
// 显示errors and warnings
define( 'WP_DEBUG_DISPLAY', true );
@ini_set( 'display_errors', 'On' );
最后,测试完成后一定要注释掉或者删除以上代码,以防坏人!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值