Professional Web Applications Themes

#25916 [Fbk]: get_browser() -> PHP Fatal error: Nesting level too deep - recursive dependency? - PHP Development

ID: 25916 Updated by: [email]thetaphiphp.net[/email] Reported By: [email]thetaphiphp.net[/email] Status: Feedback Bug Type: Scripting Engine problem Operating System: Solaris 9 PHP Version: 4.3.4RC1 New Comment: I do not think so, because it happens only when a lot of requests are done. So you cannot test it with CLI/CGI :( I could debug it when the server goes into this error by attaching dbx to PID. But to do this it would be good to check where this error could come from. Previous Comments: ------------------------------------------------------------------------ [2003-10-30 21:05:20] [email]sniperphp.net[/email] Does this happen with CLI build with ZTS enabled? ------------------------------------------------------------------------ [2003-10-20 04:30:58] [email]thetaphiphp.net[/email] Addendum: ...

  1. #1

    Default #25916 [Fbk]: get_browser() -> PHP Fatal error: Nesting level too deep - recursive dependency?

    ID: 25916
    Updated by: [email]thetaphiphp.net[/email]
    Reported By: [email]thetaphiphp.net[/email]
    Status: Feedback
    Bug Type: Scripting Engine problem
    Operating System: Solaris 9
    PHP Version: 4.3.4RC1
    New Comment:

    I do not think so, because it happens only when a lot of requests are
    done. So you cannot test it with CLI/CGI :(
    I could debug it when the server goes into this error by attaching dbx
    to PID. But to do this it would be good to check where this error could
    come from.


    Previous Comments:
    ------------------------------------------------------------------------

    [2003-10-30 21:05:20] [email]sniperphp.net[/email]

    Does this happen with CLI build with ZTS enabled?


    ------------------------------------------------------------------------

    [2003-10-20 04:30:58] [email]thetaphiphp.net[/email]

    Addendum: It is not a problem with wrong extension dir in php.ini
    (because all extensions are linked static) like in other bugs.

    The configuration phpinfo() can be found at:
    [url]http://134.1.2.11/test.php[/url]


    ------------------------------------------------------------------------

    [2003-10-20 03:39:01] [email]thetaphiphp.net[/email]

    Description:
    ------------
    The following error occurs sometimes on the ext/standard function
    get_browser():
    [20/Oct/2003:08:54:59] info (13034): for host
    p5084725C.dip.t-dialin.net trying to GET /index.php, php4_execute
    reports: PHP Fatal error: Nesting level too deep - recursive
    dependency? in /pangaea/htdocs/www.pangaea.de/index.php on line 28

    Line 28 contains the call to get_browser(). All other PHP functions do
    not fail. In other scripts which use get_browser() the error also
    occurs.

    The problem is: You cannot reproduce it, because it happens only on
    heavy server load and when it happens the first time it does not go
    away until server restart.

    PHP runs on SunONE with NSAPI, so compiled with ZTS.

    I would debug the code and fix the error; but my problem is that I do
    not know WHERE in get_browser the error occurs.

    Uwe

    Reproduce code:
    ---------------
    <?php
    // look if referer comes from google and extract search query
    //
    [url]http://www.google.de/search?sourceid=navclient&hl=de&q=%22age%2C+error% 22+pangaea[/url]
    //
    [url]http://www.google.de/search?q=%22age,+error%22+pangaea&hl=de&lr=&ie=UTF-8&filter=0[/url]
    if (isset($_GET['query'])) {
    $query=$_GET['query'];
    } else {
    if (isset($_SERVER['HTTP_REFERER']) &&
    preg_match('/^http:\/\/.*?google\..*?\/search\?(.*?)$/i',
    $_SERVER['HTTP_REFERER'], $matches)) {
    $a = split ('&', $matches[1]);
    for ($i=0; $i<count($a); $i++) {
    $b = split ('=', $a[$i]);
    $name=urldecode ($b[0]);
    $value=urldecode ($b[1]);
    switch ($name) {
    case 'q':
    $query=$value;
    break;
    case 'ie':
    $encoding=$value;
    break;
    }
    }
    }
    if (isset($query) && isset($encoding))
    $query=mb_convert_encoding($query, "ISO-8859-1", $encoding);
    }

    // detect browser
    $browser=get_browser();

    // if not crawler redirect user to homepage (do not forget to
    transmit query because referer can get invalid after redirect)
    if ((!$browser->crawler) && isset($_SERVER['PATH_INFO'])) {
    if (isset($query)) {
    header("Location:
    http://".$_SERVER['HTTP_HOST']."/?query=".urlencode($query));
    } else {
    header("Location: http://".$_SERVER['HTTP_HOST']."/");
    }
    exit();
    }

    // if a crawler like google is visiting: prepare keyword list to
    display and extract page number
    if ($browser->crawler) {
    $page=0;
    if (isset($_SERVER['PATH_INFO'])) {
    if (preg_match('/^\/(.*?)\.html$/', $_SERVER['PATH_INFO'],
    $matches)) {
    $page=$matches[1];
    } else {
    header("HTTP/1.0 404 Not Found");
    exit();
    }
    }
    $lines=file("../globals/googlelist.txt");
    if ($page*1000>=count($lines)) {
    header("HTTP/1.0 404 Not Found");
    exit();
    }
    }
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
    <HTML>
    <HEAD>
    ....



    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=25916&edit=1[/url]
    thetaphi@php.net Guest

  2. #2

    Default #25916 [Fbk]: get_browser() -> PHP Fatal error: Nesting level too deep - recursive dependency?

    ID: 25916
    Updated by: [email]thetaphiphp.net[/email]
    Reported By: [email]thetaphiphp.net[/email]
    Status: Feedback
    Bug Type: Scripting Engine problem
    Operating System: Solaris 9
    PHP Version: 4.3.4RC1
    New Comment:

    Yes I would like to do that. Could be a memory leak. I followed the
    discussion. But these fixes are for PHP5 only!


    Previous Comments:
    ------------------------------------------------------------------------

    [2003-11-17 18:33:08] [email]sniperphp.net[/email]

    mr. Richards posted some patch(es) to internals to fix some ZTS
    related issues. Maybe you should try those?


    ------------------------------------------------------------------------

    [2003-10-20 04:30:58] [email]thetaphiphp.net[/email]

    Addendum: It is not a problem with wrong extension dir in php.ini
    (because all extensions are linked static) like in other bugs.

    The configuration phpinfo() can be found at:
    [url]http://134.1.2.11/test.php[/url]


    ------------------------------------------------------------------------

    [2003-10-20 03:39:01] [email]thetaphiphp.net[/email]

    Description:
    ------------
    The following error occurs sometimes on the ext/standard function
    get_browser():
    [20/Oct/2003:08:54:59] info (13034): for host
    p5084725C.dip.t-dialin.net trying to GET /index.php, php4_execute
    reports: PHP Fatal error: Nesting level too deep - recursive
    dependency? in /pangaea/htdocs/www.pangaea.de/index.php on line 28

    Line 28 contains the call to get_browser(). All other PHP functions do
    not fail. In other scripts which use get_browser() the error also
    occurs.

    The problem is: You cannot reproduce it, because it happens only on
    heavy server load and when it happens the first time it does not go
    away until server restart.

    PHP runs on SunONE with NSAPI, so compiled with ZTS.

    I would debug the code and fix the error; but my problem is that I do
    not know WHERE in get_browser the error occurs.

    Uwe

    Reproduce code:
    ---------------
    <?php
    // look if referer comes from google and extract search query
    //
    [url]http://www.google.de/search?sourceid=navclient&hl=de&q=%22age%2C+error% 22+pangaea[/url]
    //
    [url]http://www.google.de/search?q=%22age,+error%22+pangaea&hl=de&lr=&ie=UTF-8&filter=0[/url]
    if (isset($_GET['query'])) {
    $query=$_GET['query'];
    } else {
    if (isset($_SERVER['HTTP_REFERER']) &&
    preg_match('/^http:\/\/.*?google\..*?\/search\?(.*?)$/i',
    $_SERVER['HTTP_REFERER'], $matches)) {
    $a = split ('&', $matches[1]);
    for ($i=0; $i<count($a); $i++) {
    $b = split ('=', $a[$i]);
    $name=urldecode ($b[0]);
    $value=urldecode ($b[1]);
    switch ($name) {
    case 'q':
    $query=$value;
    break;
    case 'ie':
    $encoding=$value;
    break;
    }
    }
    }
    if (isset($query) && isset($encoding))
    $query=mb_convert_encoding($query, "ISO-8859-1", $encoding);
    }

    // detect browser
    $browser=get_browser();

    // if not crawler redirect user to homepage (do not forget to
    transmit query because referer can get invalid after redirect)
    if ((!$browser->crawler) && isset($_SERVER['PATH_INFO'])) {
    if (isset($query)) {
    header("Location:
    http://".$_SERVER['HTTP_HOST']."/?query=".urlencode($query));
    } else {
    header("Location: http://".$_SERVER['HTTP_HOST']."/");
    }
    exit();
    }

    // if a crawler like google is visiting: prepare keyword list to
    display and extract page number
    if ($browser->crawler) {
    $page=0;
    if (isset($_SERVER['PATH_INFO'])) {
    if (preg_match('/^\/(.*?)\.html$/', $_SERVER['PATH_INFO'],
    $matches)) {
    $page=$matches[1];
    } else {
    header("HTTP/1.0 404 Not Found");
    exit();
    }
    }
    $lines=file("../globals/googlelist.txt");
    if ($page*1000>=count($lines)) {
    header("HTTP/1.0 404 Not Found");
    exit();
    }
    }
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
    <HTML>
    <HEAD>
    ....



    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=25916&edit=1[/url]
    thetaphi@php.net Guest

  3. Moderated Post

    Default #25916 [Fbk]: get_browser() -> PHP Fatal error: Nesting level too deep - recursive dependency?

    Removed by Administrator
    jay@php.net Guest
    Moderated Post

  4. Moderated Post

    Default #25916 [Fbk]: get_browser() -> PHP Fatal error: Nesting level too deep - recursive dependency?

    Removed by Administrator
    thetaphi@php.net Guest
    Moderated Post

Similar Threads

  1. Replies: 1
    Last Post: November 17th, 11:35 PM
  2. Replies: 0
    Last Post: October 20th, 08:31 AM
  3. Replies: 0
    Last Post: October 20th, 07:39 AM
  4. #24746 [Bgs]: Fatal error: Nesting level too deep - recursive dependency?
    By tim at sparkart dot com in forum PHP Development
    Replies: 0
    Last Post: July 22nd, 02:14 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139