Wordpress Debugging does not work

2019-07-24 14:30发布

currently I'm trying to get into Wordpress debugging.

I read the Wordpress debugging manual, I found here: https://codex.wordpress.org/Debugging_in_WordPress

I enabled debugging in my wp-config.php

define( 'WP_DEBUG',         true );
define( 'WP_DEBUG_LOG',     true );
define( 'WP_DEBUG_DISPLAY', true );
define( 'SCRIPT_DEBUG',     true );
define( 'SAVEQUERIES',      true );

But I have not output. The /var/www/html/wordpress/wp-content/ does not contain the debug.log file. And yes, the directory is writable to the Webserver. And even if I create the file by my own, there is no output to the file. Even with 777 rights. There is also no error output in the Webservers Log File. And yes, the wp-config.php file is the right one, because if I have an (syntax) error in this file, php gives me the error message.

For the installation I used a clean installed machine with a clean Wordpress installation. First of all, I was trying with nginx+php-fpm without any success, but then I also tried apache with mod-php7.0. Same result, no output to the debug.log.

So what can I do or what can I try?

1条回答
老娘就宠你
2楼-- · 2019-07-24 14:51

Try this format instead in your wp-config.php file.

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
}
查看更多
登录 后发表回答