php错误日志奇怪

php错误日志奇怪,php,error-handling,Php,Error Handling,我的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("smar

我的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)上运行良好:

wtf???在两者上运行php5,并且它曾经在vps上工作(这里的调试=1输出)——:


或者这是netsol的vps hackery的某些功能?

while中的错误日志被打印出来;您自己从生产服务器粘贴的错误日志显示“在内部while:debug\u smart404=5”


您已经错过了许多“…”背后的代码。您的代码是否可能进入while循环,但(在生产环境中)在到达其他错误日志语句之前,很快就会中断/或继续。你能肯定地排除这个问题吗?

我会再进行一次调试和检查,thanx…如果这是问题所在,那么centos/apache/php和fedora/lighttpd/php之间就有区别了:-\
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
[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