0

Just like topic says. Debug log on wordpress is not working when PHP-FPM is enabled.

I found below code somewhere on Stackoverflow but its not working.

define('WP_DEBUG', true);

if ( WP_DEBUG ) {
    // Enable Debug logging to the /wp-content/debug.log file
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );
    @ini_set( 'log_errors', 'On' );
    @ini_set( 'display_errors', 'Off' );
    @ini_set( 'error_reporting', E_ALL );
    @ini_set( 'error_log', 'php_error.log' );
    define('SAVEQUERIES', false); // show queries
    define( 'WCS_DEBUG', true ); // show scheduled jobs for WooCommerce under Tools menu
}

Is there any mod that I need to install on Apache for debug to work?

  • Try commenting out all of the `@ini_set` lines. This should create a `debug.log` file inside your `wp-content` folder (assuming that PHP has the right permissions to create said file there) as soon as a PHP warning/error message is found. Also, you don't really need the `IF` condition: if `WP_DEBUG` is false, nothing will be written to your log file anyways. – cabrerahector Oct 26 '18 at 12:14
  • First thing that I tried was standard define('WP_DEBUG', true); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false ); - which is not working – user123456789 Oct 26 '18 at 13:08

0 Answers0