|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-01-07 19:26 UTC] 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: '' PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 07:00:01 2025 UTC |
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