WordPress调试不起作用 [英] Wordpress Debugging does not work

查看:54
本文介绍了WordPress调试不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我正在尝试进入Wordpress调试.

currently I'm trying to get into Wordpress debugging.

我阅读了Wordpress调试手册,在这里找到: https://codex.wordpress.org/Debugging_in_WordPress

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

我在wp-config.php中启用了调试

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 );

但是我没有输出./var/www/html/wordpress/wp-content/不包含debug.log文件.是的,该目录可写到Web服务器.即使我自己创建文件,该文件也没有输出.即使拥有777权利.Web服务器日志文件中也没有错误输出.是的,wp-config.php文件是正确的文件,因为如果我在此文件中有一个(语法)错误,php会给我错误消息.

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.

对于安装,我使用了干净的Wordpress安装的干净机器.首先,我尝试使用nginx + php-fpm没有任何成功,但是后来我也尝试使用mod-php7.0进行apache.结果相同,没有输出到debug.log.

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?

推荐答案

在您的wp-config.php文件中尝试使用这种格式.

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
}

这篇关于WordPress调试不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆