Debug.log file is never created?

It’s the first I have seen this.
In a project I’m working on, I tried to switch on the debug mode for wordpress to see logs. Even if I activate the debug_log in wp-config.php, debug.log file is never created in /htdocs/wp-content/

wp-config.php

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

@ini_set('display_errors',0);

define('SCRIPT_DEBUG', true);

wp-content dir rights

enter image description here

load.php

if ( WP_DEBUG_LOG ) {
    ini_set( 'log_errors', 1 );
    var_dump( WP_CONTENT_DIR . '/debug.log' );
    // display correctly this => "/htdocs/wp-content/debug.log";
    ini_set( 'error_log', WP_CONTENT_DIR . '/debug.log' );
}

1
1

I found the problem.
In the Apache server, inside the php.ini, the variable…

track_errors = Off

To get this information, you can do in a phpfile phpinfo();.
So, to write the debug log file, you need to set track_errors as 'On'.

Leave a Comment