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/


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


define('SCRIPT_DEBUG', true);

wp-content dir rights

enter image description here


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' );
  • 2
    The writability of that folder is server specific, and not just the chmod, but the ownership of the folder is important. Having said that it looks like you're on a VPS, why not just use the PHP error logs instead?
    – Tom J Nowell
    Mar 15, 2018 at 19:27
  • @Tom J Nowell I'm using the plugin debug log to see logs in wordpress admin. I'm trying to trace with error_log() which files are really loaded in a broken project of one customer. This plugin needs this file. So... Sould I talk with my client to change wp-content rights on the server side ?
    – J.BizMai
    Mar 15, 2018 at 19:35
  • hmmm that sounds like a suboptimal approach, can you not run the site locally? Then you could run it and watch the php error logs in realtime, or use a debugger
    – Tom J Nowell
    Mar 15, 2018 at 19:42
  • I'm waiting for the database access to copy all data and work it on localhost.
    – J.BizMai
    Mar 15, 2018 at 19:53
  • It's a very old and suboptimal way to debug things, the codex is very old, and there are far better ways to do it, especially on a local environment where you can use a real debugger. Are PHP error logs not available? All WP_DEBUG_LOG does is change where the log files location is
    – Tom J Nowell
    Mar 15, 2018 at 19:54

2 Answers 2


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'.

  • 1
    This only stores the last error in a php variable that you can further use to script with in some other fashion. This doesn't turn on logging. Jun 5, 2020 at 3:37
  • 1
    I got the same problem as you described upstairs, and changing this did not help to fix my problem. More then that, on one site, that do create and write to debug.log, this constant value is OFF.
    – neoswf
    Feb 7, 2022 at 13:26

None of the above solutions worked for me.

So I ran phpinfo() and found that error_log = /var/log/php-fpm/www-error.log on my machine and I was finally able to see the error. In my case, a script was exceeding 30 seconds allowed of execution time.

So use phpinfo() and find out where your logs are stored!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.