define('WP_DEBUG', true); not show errors

后端 未结 4 1870
后悔当初
后悔当初 2021-01-01 22:29

I enabled the errors in my wp-config file:

define(\'WP_DEBUG\', true);

But this not work, Wordpress continues showing me a white screen, a

相关标签:
4条回答
  • 2021-01-01 23:10

    Add these two lines below the

    define('WP_DEBUG', true);
    
    error_reporting(E_ALL);
    ini_set('display_errors', 1);
    

    then delete them when you don't need them any more.

    0 讨论(0)
  • 2021-01-01 23:13

    You can write this into your .htaccess file.

    php_flag display_startup_errors on
    php_flag display_errors on
    php_flag html_errors on
    php_flag  log_errors on
    php_value error_log  /home/path/public_html/domain/PHP_errors.log
    

    Please change the error_log directory.

    0 讨论(0)
  • 2021-01-01 23:15

    Plugins or themes that are using PHP's set_exception_handler() (see the docs) can also cause errors to not be shown, because their callback might just silently ignore the error. For example, I experienced the exact same thing using NextGen Gallery, but once I deactivated it, errors appeared as normal on both the page and in the debug.log file.

    0 讨论(0)
  • 2021-01-01 23:20

    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.

    this code you must have to insert BEFORE /* That's all, stop editing! Happy blogging. */ in the wp-config.php file.

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

    sorce: https://codex.wordpress.org/Debugging_in_WordPress

    0 讨论(0)
提交回复
热议问题