簡體   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