繁体   English   中英

php error_log怪异

[英]php error_log weirdness

我的smart404.php代码中有一个全局变量debug_smart404:

$debug_smart404 = intval(get_option('debug_smart404' ));
    error_log("smart404_redirect: debug_smart404 =" . ( $debug_smart404 ) );

我使用了很多地方:

if ( $debug_smart404 > 4 ) # lotsa debug!
{
    error_log("smart404_redirect: take_1st_match=" . ( $take_1st_match  ? "yes" : "no" ) );
    error_log("smart404_redirect: take_exact_match=" . ( $take_exact_match ? "yes" : "no" ) );
    error_log("smart404_redirect: search_whole_uri=" . ( $search_whole_uri ? "yes" : "no" ) );
    error_log("smart404_redirect: walk_uri=" . ( $walk_uri ? "yes" : "no" ) );
    error_log("smart404_redirect: ignored_patterns_input=" . $patterns );
    error_log("smart404_redirect: ignored_patterns_array=" . join($patterns_array,",") );
            error_log("smart404_redirect: search_groups=" . join($search_groups,","));
}
while ( TRUE )
{
    error_log("smart404_redirect:inside while: debug_smart404 =" . ( $debug_smart404 ) );
...
    if ( $debug_smart404 > 3 ) # less debug
    {
        error_log("smart404_redirect: search_words=" . $search_words);
        }
...
        if ( $debug_smart404 > 0 ) {
            error_log("smart404_redirect: uri=" . $uri . "= #matches=" . $mct);
        } 
...
} #end while...

所以当我设置debug_smart404 == 5时,我得到了while之外实例的预期输出:

[Thu Mar 14 08:32:42 2013] [error] [client xx.xx.xx.xx] smart404_redirect: debug_smart404 =5
[Thu Mar 14 08:32:42 2013] [error] [client xx.xx.xx.xx] smart404_redirect: take_1st_match=yes
[Thu Mar 14 08:32:42 2013] [error] [client xx.xx.xx.xx] smart404_redirect: take_exact_match=yes
[Thu Mar 14 08:32:42 2013] [error] [client xx.xx.xx.xx] smart404_redirect: search_whole_uri=no
[Thu Mar 14 08:32:42 2013] [error] [client xx.xx.xx.xx] smart404_redirect: walk_uri=yes
[Thu Mar 14 08:32:42 2013] [error] [client xx.xx.xx.xx] smart404_redirect: ignored_patterns_input=wp-.*\r\n(ing|s|er|est)$\r\nprivate/.*
[Thu Mar 14 08:32:42 2013] [error] [client xx.xx.xx.xx] smart404_redirect: ignored_patterns_array=@wp-.*@i,@(ing|s|er|est)$@i,@private/.*@i,@/(trackback|feed|(comment-)?page-?[0-9]*)/?$@i,@\\.(html|php)$@i,@/?\\?.*@i
[Thu Mar 14 08:32:42 2013] [error] [client xx.xx.xx.xx] smart404_redirect: search_groups=pages,posts,categories
[Thu Mar 14 08:32:42 2013] [error] [client xx.xx.xx.xx] smart404_redirect:inside while: debug_smart404 =5

但是请注意,while循环的if语句中缺少error_log输出...但是仅在我的生产服务器上(netsol vps)

它在我的测试服务器(lighttpd)上正常工作:

2013-03-14 08:26:40: (mod_fastcgi.c.2711) FastCGI-stderr: smart404_redirect: debug_smart404 =5
smart404_redirect: take_1st_match=no
smart404_redirect: take_exact_match=no
smart404_redirect: search_whole_uri=yes
smart404_redirect: walk_uri=yes
smart404_redirect: ignored_patterns_input=wp-.*
(ing|s|er|est)$
private/.*
smart404_redirect: ignored_patterns_array=@wp-.*@i,@(ing|s|er|est)$@i,@private/.*@i,@/(trackback|feed|(comment-)?page-?[0-9]*)/?$@i,@\.(html|php)$@i,@/?\?.*@i
smart404_redirect: search_groups=pages,posts,categories
smart404_redirect:inside while: debug_smart404 =5
smart404_redirect: search_words=cavitronix.com  xxx zzzxxxx
smart404_redirect: uri=/cavitronix.com//xxx/zzzxxxx= #matches=0

wtf ??? 在两者上都运行php5,并且以前可以在vps上运行(debug = 1输出在这里)-:

[Thu Mar 14 06:32:55 2013] [error] [client xx.xx.xx.xx] smart404_redirect: uri=/how-it-works= #matches=1
[Thu Mar 14 06:41:32 2013] [error] [client xx.xx.xx.xx] smart404_redirect: uri=/videos/e2c-overview/private/awstats/current/new.html= #matches=10
[Thu Mar 14 06:53:38 2013] [error] [client xx.xx.xx.xx] smart404_redirect: uri=/current/previous.html= #matches=3
[Thu Mar 14 06:54:47 2013] [error] [client xx.xx.xx.xx] smart404_redirect: uri=/press-releases= #matches=3

还是netsol的vps黑客的某些功能?

在IS内打印错误日志; 您自己来自生产服务器的错误日志的粘贴显示为“ inside while:debug_smart404 = 5”

您已经错过了“ ...”后面的许多代码。 您的代码是否有可能进入while循环内,但随后(在生产时)在到达其他错误日志语句之前迅速爆发/或继续。 你能肯定地排除吗?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM