[Special Summer Sale] 40% OFF All Magento 2 Themes

Cart

Debugging in PHP and WordPress

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8888
    David Hoang
    Keymaster

    @ini_set('log_errors','On'); and define('WP_DEBUG', true);

    I’m trying to create a error log file , but i’m confusing about these two. what kind of errors will get by log_errors and WP_DEBUG ?

    #8889
    David Hoang
    Keymaster

    The define(‘WP_DEBUG_LOG’, true); will log errors into the debug.log file in the wp-content directory, @ini_set(‘log_errors’,’On’); allows you to specify the file where you want to save it. This should work for you:

    @ini_set('log_errors', 1);
    @ini_set('display_errors', 0); /* enable or disable public display of errors (use 'On' or 'Off') */
    @ini_set('error_log', dirname(__FILE__) . '/wp-content/logs/your-error-file.log'); /* path to server-writable log file */
    @ini_set( 'error_reporting', E_ALL ^ E_NOTICE ); /* the php parser to  all errors, excreportept notices.  */
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.