WordPress broken in the WP_DEBUG mod

Hi there,

I have an issue that when I open the WP_DEBUG mode, my website will show a warning like this: http://imgur.com/SR4tOX6 and my site will break (it's mean can't useful.).

Can you help me to fixed this warning and let my site also working on the WE_DEBUG?

  • James Morris
    • WordPress Enthusiast

    Hello leoventans,

    I hope you are well today.

    The reason you are seeing this is because, by default, WP_DEBUG will generate errors to the page. However, there's some directives you can define in wp-config.php that will hide these errors and will instead log all errors to wp-content/debug.log.

    Please change your define in wp-config.php and this will store your debug messages to wp-content/debug.log.

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

    I hope this clarifies a bit.

    Best regards,

    James Morris

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.