ID: 37381
Comment by: php at modem-help dot com
Reported By: gcp at sjeng dot org
Status: No Feedback
Bug Type: Variables related
Operating System: FreeBSD 6.0
PHP Version: 5.1.4
New Comment:
PHP 5.1.6
(RedHat FC6; std PHP, Apache; fully updated)
`auto_globals_jit = On' works fine with 'normal' PHP scripts. However,
when included via `auto_prepend_file' $_SERVER is completely absent
(together with other Globals).
Test case:
file script:
<?php
if( !empty( $GLOBALS[ '_SERVER' ])) {
$_SERVER_ARRAY = '_SERVER';
} elseif( !empty( $GLOBALS[ 'HTTP_SERVER_VARS' ])) {
$_SERVER_ARRAY = 'HTTP_SERVER_VARS';
} else {
$_SERVER_ARRAY = 'GLOBALS';
}
global ${$_SERVER_ARRAY};
$ipRemote = ${$_SERVER_ARRAY}[ 'REMOTE_ADDR' ];
var_dump($GLOBALS);
?>
httpd.conf:
<IfModule mod_php5.c>
AddType application/x-httpd-php .html
php_value auto_prepend_file "/path/to/test/file"
</IfModule>
php.ini:
variables_order = "EGPCS"
register_globals = Off
register_long_arrays = Off
register_argc_argv = On
auto_globals_jit = On
The above produces nothing ($_SERVER is absent). Change
`auto_globals_jit' to `Off' (plus `apachectl graceful') and it works.
Time to pay attention to this, folks.
- Alex Kemp
Previous Comments:
------------------------------------------------------------------------
[2006-06-09 11:01:45] me at thomaskeller dot biz
I forgot to mention: I'm using the apache2handler with httpd-2.2.0
------------------------------------------------------------------------
[2006-06-09 10:57:48] me at thomaskeller dot biz
I've encountered the same problem, with a normal rpm installation of
php-5.1.4-1 which ships with FC5.
A simple reproducable script would be
<? var_dump($_SERVER); ?>
which returns NULL if auto_globals_jit is set to on (default in this
rpm package). This is the same deal with $_REQUEST, which is also NULL.
Now, even if auto_globals_jit is set to false, $_GLOBALS is still not
available.
------------------------------------------------------------------------
[2006-06-01 01:00:00] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2006-05-24 21:59:33] [EMAIL PROTECTED]
Unfortunately, I don't think anybody will be able to find time to debug
phpMyAdmin.
So please provide a short but complete reproduce script to speedup the
resolution of the issue.
------------------------------------------------------------------------
[2006-05-10 11:19:09] gcp at sjeng dot org
I don't know of any small testcase. As indicated, this is 100% a
regression in PHP 5.1.3 or 5.1.4 compared to 5.1.2, it's possible to
make it appear/disappear by toggling the indicated PHP setting, and it
happens with a very popular PHP package, in the routine mentioned
earlier.
I can provide help tracing the issue, but I do not have a "10-20 line
reproducible case".
------------------------------------------------------------------------
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
http://bugs.php.net/37381
--
Edit this bug report at http://bugs.php.net/?id=37381&edit=1