#26833 [NEW]: Globals not being defined with 'register_globals On' at random
| From: | php at f0e dot net | Date: | Thu, 08 Jan 2004 00:26:18 +0000 |
| Subject: | #26833 [NEW]: Globals not being defined with 'register_globals On' at random | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-52944@lists.php.net to get a copy of this message | ||
From: php at f0e dot net
Operating system: FreeBSD 5.1-RELEASE-p10
PHP version: 4.3.4
PHP Bug Type: Variables related
Bug description: Globals not being defined with 'register_globals On' at random
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 bug report at http://bugs.php.net/?id=26833&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26833&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26833&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=26833&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=26833&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=26833&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=26833&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=26833&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=26833&r=support
Expected behavior: http://bugs.php.net/fix.php?id=26833&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=26833&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=26833&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=26833&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26833&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=26833&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=26833&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=26833&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26833&r=float