wordpress 打开debug模式

前言

wordpress大家都不陌生,一款优秀的开源博客系统。但它的debug模式是默认不开的,所以当我们在前端报错时,并不能准确地知道原因所在。所以打开debug模式是很重要的。

正文

要想打开debug模式,我们需要:

  1. 进入到wp的安装目录,修改文件wp-config

  2. 注释:

    #define('WP_DEBUG', false);
    
  3. 添加:

    ini_set('log_errors','On');
    
    ini_set('display_errors','On');
    
    ini_set('error_reporting', E_ALL );
    
    define('WP_DEBUG', true);
    
    define('WP_DEBUG_LOG', true);
    
    define('WP_DEBUG_DISPLAY', true);
    

就可以了。

原文地址:https://www.cnblogs.com/young233/p/12844101.html