ID: 26833
User updated by: php at f0e dot net
Reported By: php at f0e dot net
-Status: Feedback
+Status: Open
Bug Type: Variables related
Operating System: FreeBSD 5.1-RELEASE-p10
PHP Version: 4.3.4
New Comment:
I added:
var_dump(ini_get('register_globals'));
to the top of the code..
When $REMOTE_ADDR was being defined correctly, the first line was
'string(1) "1"'.
After a few more refreshes, $REMOTE_ADDR wasn't defined and the first
line was changed to 'string(1) "0"'.
I do not have a .htaccess file in the script's directory or parent
directory nor am I setting any php values in the httpd.conf.
I will try the snapshot.
Thanks
Previous Comments:
------------------------------------------------------------------------
[2004-01-07 19:49:59] [EMAIL PROTECTED]
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
And do you by any chance set any php.ini options inside any .htaccess
file or in httpd.conf ? (with php_flag / php_value / php_admin_flag /
php_admin_value)
Also, check that register_globals is actually 'On' during execution by
adding this to your test script:
var_dump(ini_get('register_globals'));
------------------------------------------------------------------------
[2004-01-07 19:26:18] php at f0e dot net
Description:
------------
Running Apache/2.0.48 and PHP 4.3.4
PHP configuration:
'./configure' '--with-mysql' '--with-apxs2=/usr/local/apache2/bin/apxs'
'--with-openssl' '--enable-magic-quotes' '--with-zlib' '--with-gd'
'--with-freetype-dir' '--with-jpeg-dir' '--enable-gd-native-ttf'
'--enable-mime-magic' '--disable-cgi' '--with-mhash'
Changes to the php.ini-dist: 'register_globals = On', 'display_errors =
Off', 'log_errors = On'
when I attempt to access (normally) global variables (like $REMOTE_ADDR
-- I know I should be using $_SERVER[REMOTE_ADDR] but I cannot force my
clients to update all their scripts), maybe 1/10th of the time
$REMOTE_ADDR is undefined. $_SERVER[REMOTE_ADDR] is defined all the
time however.
I tried moving back to 4.3.3 which still experiences the same problem.
Reproduce code:
---------------
<?
print "REMOTE_ADDR: '$_SERVER[REMOTE_ADDR]'<br>\n";
print "REMOTE_ADDR: '$REMOTE_ADDR'";
?>
Expected result:
----------------
REMOTE_ADDR: '127.0.0.1'<br>
REMOTE_ADDR: '127.0.0.1'
Actual result:
--------------
REMOTE_ADDR: '127.0.0.1'<br>
REMOTE_ADDR: ''
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26833&edit=1