admin管理员组文章数量:1122846
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
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' );
}
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
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' );
}
Share
Improve this question
asked Mar 15, 2018 at 19:09
J.BizMaiJ.BizMai
9002 gold badges10 silver badges30 bronze badges
8
|
Show 3 more comments
2 Answers
Reset to default 11I 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'
.
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!
本文标签: Debuglog file is never created
版权声明:本文标题:Debug.log file is never created? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736301174a1931087.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
WP_DEBUG_LOG
does is change where the log files location is – Tom J Nowell ♦ Commented Mar 15, 2018 at 19:54