Edit report at http://bugs.php.net/bug.php?id=29176&edit=1
ID: 29176 Comment by: php at caves dot org dot uk Reported by: webmaster at ragnarokonline dot de Summary: $GLOBALS['_REQUEST'], $GLOBALS['_ENV'] AND $GLOBALS['_SERVER'] are empty Status: Wont fix Type: Bug Package: Variables related Operating System: All PHP Version: 5.0.0 Assigned To: sesser New Comment: An alternative to the workaround of putting "register_long_arrays = On", in php.ini is to include a reference to $_SERVER (etc) *anywhere* in your PHP script. This seems to trigger the population of $GLOBALS with the correct data. The following example demonstrates this. Un-comment the lines at the bottom to implement and demonstrate the work-around. echo "_SERVER array is {$GLOBALS['_SERVER']} <BR>"; echo "_GET array is {$GLOBALS['_GET']} <BR>"; echo "_POST array is {$GLOBALS['_POST']} <BR>"; echo "_FILES array is {$GLOBALS['_FILES']} <BR>"; echo "_COOKIE array is {$GLOBALS['_COOKIE']} <BR>"; echo "_REQUEST array is {$GLOBALS['_REQUEST']} <BR>"; echo "_ENV array is {$GLOBALS['_ENV']} <BR><BR>"; //echo "\$_SERVER is $_SERVER<BR>"; //echo "\$_REQUEST is $_REQUEST<BR>"; //echo "\$_ENV is $_ENV<BR>"; Previous Comments: ------------------------------------------------------------------------ [2004-11-12 08:46:06] der...@php.net $GLOBALS["_SERVER"] would be silly to use anyway. I am going to mark this as Wont Fix as this is not guaranteed to work. ------------------------------------------------------------------------ [2004-11-11 10:58:20] webmaster at ragnarokonline dot de Yes, I could reproduce this without using mmcache. This is dependent of auto_globals_jit. The problem is, that for example var_dump($_SERVER); does trigger the jit, but that var_dump($GLOBALS['_SERVER']); doesn't. ------------------------------------------------------------------------ [2004-11-11 09:56:02] tony2...@php.net Can you reproduce it without mmcache enabled ? ------------------------------------------------------------------------ [2004-11-11 09:17:12] marrtins at hackers dot lv i think this is a mmcache issue. today i get similar problems - once file is loaded with mmcache it is ok, next time there is no more $_SERVER variable executing that script again. notice, that it happens with apache (v 1.3.33), from command line same script works well (php5.0.2). also, with php4.3.7+apache1.3.27 it works as excpected too. ------------------------------------------------------------------------ [2004-08-24 03:12:00] webmaster at ragnarokonline dot de Changing OS from SuSE 9.0 to All, since this is not limited to SuSE. ------------------------------------------------------------------------ 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/bug.php?id=29176 -- Edit this bug report at http://bugs.php.net/bug.php?id=29176&edit=1