Professional Web Applications Themes

#23580 [Com]: Random values for include_path - PHP Development

ID: 23580 Comment by: ns at canada dot com Reported By: maximiliano dot marques at bol dot com dot br Status: Open Bug Type: Apache related Operating System: Conectiva Linux 8 Kernel 2.4.19 PHP Version: 4.3.2 New Comment: We've been having this problem as well. In support of the caching hypothesis, here's some info I've collected. This is PHP 4.3.2; phpinfo() is available at [url]http://nbtsc.org/~noam/info.php[/url] The include_path for our server is set in php.ini to ".:/usr/share/pear". phpinfo() verifies this as the master setting. Output from 'ps xaf' showing the httpd processes: 30908 ? SN 0:02 httpd 30930 ? SN 0:00 ...

  1. #1

    Default #23580 [Com]: Random values for include_path

    ID: 23580
    Comment by: ns at canada dot com
    Reported By: maximiliano dot marques at bol dot com dot br
    Status: Open
    Bug Type: Apache related
    Operating System: Conectiva Linux 8 Kernel 2.4.19
    PHP Version: 4.3.2
    New Comment:

    We've been having this problem as well. In support of the caching
    hypothesis, here's some info I've collected.

    This is PHP 4.3.2; phpinfo() is available at
    [url]http://nbtsc.org/~noam/info.php[/url]

    The include_path for our server is set in php.ini to
    ".:/usr/share/pear". phpinfo() verifies this as the master setting.

    Output from 'ps xaf' showing the httpd processes:

    30908 ? SN 0:02 httpd
    30930 ? SN 0:00 \_ httpd
    30932 ? SN 0:00 | \_ httpd
    30936 ? SN 1:52 | \_ httpd
    30962 ? SN 2:00 | \_ httpd
    .... (30963 through 30985)
    30986 ? SN 0:01 | \_ httpd
    19881 ? SN 0:00 \_ httpd
    19882 ? SN 0:00 | \_ httpd
    19884 ? SN 1:41 | \_ httpd
    .... (19885 through 19908)
    19909 ? SN 0:01 | \_ httpd
    11727 ? SN 0:00 \_ httpd
    11728 ? SN 0:00 \_ httpd
    11730 ? SN 0:15 \_ httpd
    .... (11731 through 11754)
    11755 ? SN 0:00 \_ httpd

    I then ran 'w3m -dump' in a loop, loading this simple php script 100
    times:

    <?php
    print "getmypid() = " . getmypid() . " ";
    print "ini_get(include_path) = " . ini_get("include_path") . "<br
    />\n";
    ?>

    I find the output rather interesting. All the requests served by PIDs
    in the 30 range (one branch of the httpd process tree) are have
    consistently incorrect include_path="tes/info.nbtsc.org/photos/" (which
    is a fragment of the path '/home/sites/info.nbtsc.org/photos'). All the
    requests served by PIDs in the 19 range have consistently correct
    include_path=".:/usr/share/pear". The requests served by PIDs in the
    11 range have varying include_paths; sometimes, when the same
    process served a second request, it had a different include path from
    the first time. The include_paths from the 11 range are either
    ".:/usr/share/pear", "2.php", or (in hexadecimal) 0x58 0xCC 0x20 0x20.
    What I haven't been able to figure out is where these include_paths are
    coming from.

    I will see what more I can track down, and zeev, I can check with the
    main server administrator to see about getting you temporary access.
    What level of access would you need?

    Noam


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

    [2003-07-23 10:33:02] [email]zeevphp.net[/email]

    I'm trying to reproduce this, but so far without any success. I tried
    to stress-test PHP with multiple vhosts and see if there are any
    'leaks' of include_paths - but after hundreds of thousands of requests,
    there were none.

    I'm very interested in what you say about the single-process mode.
    Basically, what you describe is *not* the behavior PHP is supposed to
    display. The include_path settings should go back to its original
    setting at the end of each request. This is also the behavior that I'm
    seeing in my setup.

    How did you determine that the include_path setting remains 'cached'?

    If that is really the case, then it would greatly help if you could
    provide me with temporary access to your server, so I can debug this.

    If it's not the case, then it appears we're back in square one...

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

    [2003-07-16 07:42:21] katana at katana-inc dot com

    We have experienced the same problem here since a few month. I was told
    that it was gonna be fixed in 4.3.2 but it looks like it's still here
    (we were warned by a disk full error because of the error logged filled
    with failed includes from an auto_prepend file that belongs to another
    vhost).

    We can't upgrade to a snapshot since it is a production server.

    We are running Gentoo but the same was happening with RedHat 8, running
    apache 1.3.27.

    The only fix was to change MaxRequestPerChild to 1...

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

    [2003-06-25 07:34:48] maximiliano dot marques at bol dot com dot br

    First answering your questions:
    >Do you set the include_path for _every_ vhost?
    Not every but almost. I have 7 vhosts and 5 using different
    include_path values.
    >Do you have php.ini and is it loaded?
    Yes, I do and it was loaded since it appear in phpinfo() briefing.
    >What is the include_path setting in your php.ini?
    include_path = "."
    >How many vhosts do you have in your httpd.conf?
    7 and I use dynamic IP for all. 3 of them are using same DoentRoot
    but different include_path values.
    >If you start apache in single server mode, does it still
    happen for every request? (httpd -X -F -DSSL)
    Yes, it does. However as in this case there is only one process
    running, at first request it keep the include_path value forever. I am
    explaining better below.

    Second I executed several tests including your recommendations above,
    adding _“_ around the path and I used netstat and ps to follow httpd
    child process behavior while I running your suggested script:
    <?php echo ini_get('include_path'); ?>

    My conclusion was that the first request that a child process run with
    include_path given, it cache the value for include_path (no matter if
    it was set in httpd.conf or .htaccess, I tried with both) and child
    process never change include_path value anymore while it still alive.

    I am using ‘MaxRequestsPerChild 1’ as workaround and however it is
    working, performance is debilitated.

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

    [2003-06-23 20:13:55] [email]sniperphp.net[/email]

    Try adding "'s around the path. (I always have them around the paths,
    e.g. 'php_value include_path "/www/common/:."')

    Some questions we need get answers for:
    Do you set the include_path for _every_ vhost?
    Do you have php.ini and is it loaded?
    What is the include_path setting in your php.ini?
    How many vhosts do you have in your httpd.conf?
    If you start apache in single server mode, does it still
    happen for every request? (httpd -X -F -DSSL)

    Please run all these tests using this script:

    <?php echo ini_get('include_path'); ?>


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

    [2003-06-19 02:25:19] maximiliano dot marques at bol dot com dot br

    Yes I did and it behave exactly the same.

    And I also compiled without
    --with-regex=system
    --enable-inline-optimization

    and nothing changed.

    I have set include_path in httpd.conf. The follow code I extracted from
    my httpd.conf. I am working only with virtual hosts.

    <VirtualHost *:80>
    ServerAdmin [email]marquesmaximiliano.info[/email]
    DoentRoot /sites/imax/http
    ServerName imax.maximiliano.info
    ServerAlias imax [url]www.imaxmedia.com.br[/url]
    ErrorLog logs/imax-error_log
    CustomLog logs/imax-access_log common
    php_value include_path
    ..:/sites/imax/includes:/sites/imax/instance/imx/includes
    Alias /photo/ "/sites/imax/instance/imx/photo/"
    Alias /file/ "/sites/imax/instance/imx/file/"
    Alias /img/ "/sites/imax/instance/imx/img/"
    Alias /img_dyn/ "/sites/imax/instance/imx/img_dyn/"
    Alias /style/ "/sites/imax/instance/imx/style/"
    Alias /https/ "/sites/imax/https/"
    </VirtualHost>

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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    [url]http://bugs.php.net/23580[/url]

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

    ns at canada dot com Guest

  2. #2

    Default #23580 [Com]: Random values for include_path

    ID: 23580
    Comment by: php at techmeridian dot com
    Reported By: maximiliano dot marques at bol dot com dot br
    Status: Feedback
    Bug Type: Apache related
    Operating System: Conectiva Linux 8 Kernel 2.4.19
    PHP Version: 4.3.2
    New Comment:

    This problem is getting real serious for us!
    It still exists in the current version PHP4.3.2 and the current
    SNAPSHOT.

    Our setup:
    PHP 4.3.2 and the lastest SNAP
    Apache 1.3.27

    './configure' 'i386-redhat-linux' '--prefix=/usr' '--exec-prefix=/usr'
    '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc'
    '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib'
    '--libexecdir=/usr/libexec' '--localstatedir=/var'
    '--sharedstatedir=/usr/com' '--mandir=/usr/share/man'
    '--infodir=/usr/share/info' '--with-config-file-path=/etc'
    '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic'
    '--disable-rpath' '--enable-inline-optimization' '--with-bz2'
    '--with-db3' '--with-dom=/usr' '--with-exec-dir=/usr/bin'
    '--with-png-dir=/usr' '--with-gd' '--with-gdbm' '--with-gettext'
    '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr'
    '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system'
    '--with-xml' '--with-expat-dir=/usr' '--with-layout=GNU'
    '--enable-bcmath' '--enable-ftp' '--enable-sockets'
    '--enable-track-vars' '--enable-wddx' '--with-kerberos=/usr/kerberos'
    '--with-ldap=shared' '--enable-calendar' '--enable-dio' '--enable-dbx'
    '--enable-mbstring' '--enable-mbstr-enc-trans'
    '--with-apxs=/usr/sbin/apxs' '--enable-yp' '--enable-pic'
    '--without-oci8' '--enable-safe-mode' '--enable-magic-quotes'
    '--with-mysql=/usr' '--with-pgsql=/usr' '--with-curl=/usr'
    '--with-imap' '--with-freetype2' '--with-freetype'
    '--enable-gd-native-ttf' '--with-zlib' '--with-freetype-dir=/usr'
    '--with-ttf=/usr'


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

    [2003-08-15 08:33:28] [email]sniperphp.net[/email]

    Please try using this CVS snapshot:

    [url]http://snaps.php.net/php4-STABLE-latest.tar.gz[/url]

    For Windows:

    [url]http://snaps.php.net/win32/php4-win32-STABLE-latest.zip[/url]

    And adjust the version accordingly if problem persists.


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

    [2003-08-07 01:38:57] ns at canada dot com

    Looks like the caching isn't happening quite like I
    thought it was. Running this script a couple of times
    in the same httpd process:

    <?php
    print "getmypid() = " . getmypid() . " ";
    print "ini_get(include_path) = " .
    ini_get("include_path") . "<br />\n";
    print "Setting include_path...<br />\n";
    ini_set("include_path", "/home/users/noam/
    web");
    print "getmypid() = " . getmypid() . " ";
    print "ini_get(include_path) = " .
    ini_get("include_path") . "<br />\n";
    ?>

    shows that the include_path is always as configured in
    php.ini at the beginning of the script. (i.e. the
    ini_set doesn't persist.)

    Using Apache 2.0.47.

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

    [2003-08-07 01:13:14] ns at canada dot com

    We've been having this problem as well. In support of the caching
    hypothesis, here's some info I've collected.

    This is PHP 4.3.2; phpinfo() is available at
    [url]http://nbtsc.org/~noam/info.php[/url]

    The include_path for our server is set in php.ini to
    ".:/usr/share/pear". phpinfo() verifies this as the master setting.

    Output from 'ps xaf' showing the httpd processes:

    30908 ? SN 0:02 httpd
    30930 ? SN 0:00 \_ httpd
    30932 ? SN 0:00 | \_ httpd
    30936 ? SN 1:52 | \_ httpd
    30962 ? SN 2:00 | \_ httpd
    .... (30963 through 30985)
    30986 ? SN 0:01 | \_ httpd
    19881 ? SN 0:00 \_ httpd
    19882 ? SN 0:00 | \_ httpd
    19884 ? SN 1:41 | \_ httpd
    .... (19885 through 19908)
    19909 ? SN 0:01 | \_ httpd
    11727 ? SN 0:00 \_ httpd
    11728 ? SN 0:00 \_ httpd
    11730 ? SN 0:15 \_ httpd
    .... (11731 through 11754)
    11755 ? SN 0:00 \_ httpd

    I then ran 'w3m -dump' in a loop, loading this simple php script 100
    times:

    <?php
    print "getmypid() = " . getmypid() . " ";
    print "ini_get(include_path) = " . ini_get("include_path") . "<br
    />\n";
    ?>

    I find the output rather interesting. All the requests served by PIDs
    in the 30 range (one branch of the httpd process tree) are have
    consistently incorrect include_path="tes/info.nbtsc.org/photos/" (which
    is a fragment of the path '/home/sites/info.nbtsc.org/photos'). All the
    requests served by PIDs in the 19 range have consistently correct
    include_path=".:/usr/share/pear". The requests served by PIDs in the
    11 range have varying include_paths; sometimes, when the same
    process served a second request, it had a different include path from
    the first time. The include_paths from the 11 range are either
    ".:/usr/share/pear", "2.php", or (in hexadecimal) 0x58 0xCC 0x20 0x20.
    What I haven't been able to figure out is where these include_paths are
    coming from.

    I will see what more I can track down, and zeev, I can check with the
    main server administrator to see about getting you temporary access.
    What level of access would you need?

    Noam

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

    [2003-07-23 10:33:02] [email]zeevphp.net[/email]

    I'm trying to reproduce this, but so far without any success. I tried
    to stress-test PHP with multiple vhosts and see if there are any
    'leaks' of include_paths - but after hundreds of thousands of requests,
    there were none.

    I'm very interested in what you say about the single-process mode.
    Basically, what you describe is *not* the behavior PHP is supposed to
    display. The include_path settings should go back to its original
    setting at the end of each request. This is also the behavior that I'm
    seeing in my setup.

    How did you determine that the include_path setting remains 'cached'?

    If that is really the case, then it would greatly help if you could
    provide me with temporary access to your server, so I can debug this.

    If it's not the case, then it appears we're back in square one...

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

    [2003-07-16 07:42:21] katana at katana-inc dot com

    We have experienced the same problem here since a few month. I was told
    that it was gonna be fixed in 4.3.2 but it looks like it's still here
    (we were warned by a disk full error because of the error logged filled
    with failed includes from an auto_prepend file that belongs to another
    vhost).

    We can't upgrade to a snapshot since it is a production server.

    We are running Gentoo but the same was happening with RedHat 8, running
    apache 1.3.27.

    The only fix was to change MaxRequestPerChild to 1...

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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    [url]http://bugs.php.net/23580[/url]

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

    php at techmeridian dot com Guest

  3. #3

    Default #23580 [Com]: Random values for include_path

    ID: 23580
    Comment by: php at techmeridian dot com
    Reported By: maximiliano dot marques at bol dot com dot br
    Status: Open
    Bug Type: Apache related
    Operating System: Conectiva Linux 8 Kernel 2.4.19
    PHP Version: 4.3.3RC5-dev
    New Comment:

    Any luck looking at the files we sent?

    We are looking into the code as well, but it is taking us a very long
    time to get into the core...

    Thanks


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

    [2003-08-26 23:35:15] [email]sniperphp.net[/email]

    I got the files, thank you.


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

    [2003-08-22 22:25:26] [email]sniperphp.net[/email]

    Please start by reducing your configs (php.ini / httpd.conf / etc) to
    bare minimum with which you still can reproduce this reliably. (I would
    guess this should be possible to reproduce with only 2 virtualhosts)

    php.ini: Remove all settings which you have not touched

    Then send me those files.


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

    [2003-08-22 22:05:10] maximiliano dot marques at bol dot com dot br

    Yes I have just tried the latest snap from snaps.php.net and this
    problem still exists!

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

    [2003-08-15 08:33:28] [email]sniperphp.net[/email]

    Please try using this CVS snapshot:

    [url]http://snaps.php.net/php4-STABLE-latest.tar.gz[/url]

    For Windows:

    [url]http://snaps.php.net/win32/php4-win32-STABLE-latest.zip[/url]

    And adjust the version accordingly if problem persists.


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

    [2003-08-07 01:38:57] ns at canada dot com

    Looks like the caching isn't happening quite like I
    thought it was. Running this script a couple of times
    in the same httpd process:

    <?php
    print "getmypid() = " . getmypid() . " ";
    print "ini_get(include_path) = " .
    ini_get("include_path") . "<br />\n";
    print "Setting include_path...<br />\n";
    ini_set("include_path", "/home/users/noam/
    web");
    print "getmypid() = " . getmypid() . " ";
    print "ini_get(include_path) = " .
    ini_get("include_path") . "<br />\n";
    ?>

    shows that the include_path is always as configured in
    php.ini at the beginning of the script. (i.e. the
    ini_set doesn't persist.)

    Using Apache 2.0.47.

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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    [url]http://bugs.php.net/23580[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=23580&edit=1[/url]
    php at techmeridian dot com Guest

  4. #4

    Default #23580 [Com]: Random values for include_path

    ID: 23580
    Comment by: php at techmeridian dot com
    Reported By: maximiliano dot marques at bol dot com dot br
    Status: Open
    Bug Type: Apache related
    Operating System: Conectiva Linux 8 Kernel 2.4.19
    PHP Version: 4.3.3RC5-dev
    New Comment:

    Is there any action towards a resolution of this bug?
    I will do just about anything to help get this bug resolved...


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

    [2003-09-03 11:08:27] php at techmeridian dot com

    So what can we do to help out now? I would love to help in any other
    way possible, but I guess we just need some direction in what and how
    to help now?

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

    [2003-09-01 11:28:58] [email]sniperphp.net[/email]

    no luck, I created my own test environment but was unable to reproduce
    this problem.


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

    [2003-09-01 11:26:34] php at techmeridian dot com

    Any luck looking at the files we sent?

    We are looking into the code as well, but it is taking us a very long
    time to get into the core...

    Thanks

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

    [2003-08-26 23:35:15] [email]sniperphp.net[/email]

    I got the files, thank you.


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

    [2003-08-22 22:25:26] [email]sniperphp.net[/email]

    Please start by reducing your configs (php.ini / httpd.conf / etc) to
    bare minimum with which you still can reproduce this reliably. (I would
    guess this should be possible to reproduce with only 2 virtualhosts)

    php.ini: Remove all settings which you have not touched

    Then send me those files.


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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    [url]http://bugs.php.net/23580[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=23580&edit=1[/url]
    php at techmeridian dot com Guest

  5. #5

    Default #23580 [Com]: Random values for include_path

    ID: 23580
    Comment by: andre at digirati dot com dot br
    Reported By: maximiliano dot marques at bol dot com dot br
    Status: Open
    Bug Type: Apache related
    Operating System: Conectiva Linux 8 Kernel 2.4.19
    PHP Version: 4.3.3RC5-dev
    New Comment:

    We've had this problem with some customers too. Asking them to change
    their 'include' directives to use the full path to the files to be
    included solved the problem.


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

    [2003-09-19 15:05:22] php at techmeridian dot com

    Is there any action towards a resolution of this bug?
    I will do just about anything to help get this bug resolved...

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

    [2003-09-03 11:08:27] php at techmeridian dot com

    So what can we do to help out now? I would love to help in any other
    way possible, but I guess we just need some direction in what and how
    to help now?

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

    [2003-09-01 11:28:58] [email]sniperphp.net[/email]

    no luck, I created my own test environment but was unable to reproduce
    this problem.


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

    [2003-09-01 11:26:34] php at techmeridian dot com

    Any luck looking at the files we sent?

    We are looking into the code as well, but it is taking us a very long
    time to get into the core...

    Thanks

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

    [2003-08-26 23:35:15] [email]sniperphp.net[/email]

    I got the files, thank you.


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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    [url]http://bugs.php.net/23580[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=23580&edit=1[/url]
    andre at digirati dot com dot br Guest

Similar Threads

  1. #7174 [Csd->Bgs]: Round-robin -like values for include_path
    By sniper@php.net in forum PHP Development
    Replies: 0
    Last Post: October 4th, 04:56 AM
  2. #23580 [Opn->Bgs]: Random values for include_path
    By sniper@php.net in forum PHP Development
    Replies: 0
    Last Post: October 4th, 04:53 AM
  3. #23580 [Opn]: Random values for include_path
    By zeev@php.net in forum PHP Development
    Replies: 1
    Last Post: September 1st, 04:28 PM
  4. #23580 [Opn->Fbk]: Random values for include_path
    By sniper@php.net in forum PHP Development
    Replies: 1
    Last Post: August 23rd, 03:25 AM
  5. #23580 [NoF->Opn]: Random values for include_path
    By maximiliano dot marques at bol dot com dot br in forum PHP Development
    Replies: 0
    Last Post: August 23rd, 03:05 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