From: gcp at sjeng dot org Operating system: FreeBSD 6.0 PHP version: 5.1.4 PHP Bug Type: Variables related Bug description: auto_globals_jit fails to correctly intialize variables
Description: ------------ In some circumstances, global variables will fail to be initialized when auto_globals_jit is enabled (the default). This is a regression, the problem did not exist in 5.1.2. php.ini is default recommended one. Server is lighttpd 1.4.11 using PHP in FastCGI mode. Reproduce code: --------------- Using for example, phpMyAdmin 2.8.0.3, and looking in the libaries/Config.class.php code: function checkPmaAbsoluteUri() { // Setup a default value to let the people and lazy syadmins work anyway, // they'll get an error if the autodetect code doesn't work $pma_absolute_uri = $this->get('PmaAbsoluteUri'); if ( strlen($pma_absolute_uri) < 1 ) { $url = array(); // At first we try to parse REQUEST_URI, it might contain full URI if ( ! empty($_SERVER['REQUEST_URI'] ) ) { $url = parse_url($_SERVER['REQUEST_URI']); } // If we don't have scheme, we didn't have full URL so we need to // dig deeper if ( empty( $url['scheme'] ) ) { // Scheme if ( ! empty( $_SERVER['HTTP_SCHEME'] ) ) { $url['scheme'] = $_SERVER['HTTP_SCHEME']; } else { $url['scheme'] = !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off' ? 'https' : 'http'; } etc... It's possible to enter this function with $_SERVER missing essential things such as HTTP_HOST: array(4) { ["PHP_SELF"]=> string(21) "/mysqladmin/index.php" ["PHP_AUTH_USER"]=> (censored) ["PHP_AUTH_PW"]=> (censored) ["REQUEST_TIME"]=> int(1147178223) } If auto_global_jit is disabled, this does not not happen, and HTTP_HOST etc are set correctly. -- Edit bug report at http://bugs.php.net/?id=37381&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37381&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37381&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37381&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=37381&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=37381&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=37381&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=37381&r=needscript Try newer version: http://bugs.php.net/fix.php?id=37381&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=37381&r=support Expected behavior: http://bugs.php.net/fix.php?id=37381&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=37381&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=37381&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=37381&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37381&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=37381&r=dst IIS Stability: http://bugs.php.net/fix.php?id=37381&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=37381&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=37381&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=37381&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=37381&r=mysqlcfg