Bug #69081 [NEW]: $_SERVER variable sometimes undefined
| From: | djbrainnrg at gmail dot com | Date: | Thu, 19 Feb 2015 14:31:00 +0000 |
| Subject: | Bug #69081 [NEW]: $_SERVER variable sometimes undefined | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-190817@lists.php.net to get a copy of this message | ||
From: djbrainnrg at gmail dot com
Operating system: Windows 7 64bit
PHP version: master-Git-2015-02-19 (snap)
Package: Unknown/Other Function
Bug Type: Bug
Bug description:$_SERVER variable sometimes undefined
Description:
------------
Coming from this 64bit build ->
http://windows.php.net/downloads/snaps/master/r400e65e/php-master-ts-windows-vc11-x64-r400e65e.zip
Running with apache 2.4.12 Win64.
For an unknown reason sometimes, very rare, the variable $_SERVER isn't
available -> I have the failure everytime at the same place but i cannot
provide a reproducable example because that only happens in combination
with our used framework.
Also it only happens on the third request in a row.
Request 1: Main Page Load - Normal GET request
Request 2: Ajax Request to another page - Loaded directly on pageload
Request 3: Ajax Request to another page - Loaded directly on pageload =>
Error happens here
I can prevent the failure by adding just the line
$_SERVER;
at the begin of the script execution chain, lets say on the entry page.
Also i can prevent this failure with this option disabled in
auto_globals_jit = Off
in php.ini
Full debug_backtrace bellow, i know it may not help that mutch but i
don't have anything better for debugging right now.
Test script:
---------------
Cannot provide an example yet.
Actual result:
--------------
Notice: Undefined variable: _SERVER in
C:\www\ouced\live\modules\Ouced\src\class\Request.class.php on line 198
array(11) {
[0]=>
array(7) {
["file"]=>
string(42) "C:\www\ouced\live\modules\Caritas\init.php"
["line"]=>
int(66)
["function"]=>
string(7) "getHost"
["class"]=>
string(13) "Ouced_Request"
["object"]=>
object(Ouced_Request)#17 (1) {
["headers":"Ouced_Request":private]=>
NULL
}
["type"]=>
string(2) "->"
["args"]=>
array(0) {
}
}
[1]=>
array(4) {
["file"]=>
string(59)
"C:\www\ouced\live\modules\Ouced\src\class\FS\File.class.php"
["line"]=>
int(408)
["args"]=>
array(1) {
[0]=>
string(42) "C:\www\ouced\live\modules\Caritas\init.php"
}
["function"]=>
string(12) "include_once"
}
[2]=>
array(7) {
["file"]=>
string(58)
"C:\www\ouced\live\modules\Ouced\src\class\Module.class.php"
["line"]=>
int(65)
["function"]=>
string(11) "includeFile"
["class"]=>
string(13) "Ouced_FS_File"
["object"]=>
object(Ouced_FS_File)#15 (11) {
["directory":"Ouced_FS_File":private]=>
NULL
["filename":"Ouced_FS_File":private]=>
NULL
["filenameHash":"Ouced_FS_File":private]=>
NULL
["extension":"Ouced_FS_File":private]=>
NULL
["filesize":"Ouced_FS_File":private]=>
NULL
["accessTime":"Ouced_FS_File":private]=>
NULL
["modificationTime":"Ouced_FS_File":private]=>
NULL
["contents":"Ouced_FS_File":private]=>
NULL
["alias":"Ouced_FS_File":private]=>
NULL
["absolutePath"]=>
string(42) "C:\www\ouced\live\modules\Caritas\init.php"
["relativePath"]=>
string(24) "modules\Caritas\init.php"
}
["type"]=>
string(2) "->"
["args"]=>
array(2) {
[0]=>
bool(true)
[1]=>
bool(false)
}
}
[3]=>
array(6) {
["file"]=>
string(63)
"C:\www\ouced\live\modules\Ouced\src\class\Initializer.class.php"
["line"]=>
int(77)
["function"]=>
string(14) "registerModule"
["class"]=>
string(12) "Ouced_Module"
["type"]=>
string(2) "::"
["args"]=>
array(1) {
[0]=>
string(7) "Caritas"
}
}
[4]=>
array(6) {
["file"]=>
string(53) "C:\www\ouced\live\modules\Ruh\config\basic.config.php"
["line"]=>
int(36)
["function"]=>
string(14) "registerModule"
["class"]=>
string(17) "Ouced_Initializer"
["type"]=>
string(2) "::"
["args"]=>
array(1) {
[0]=>
string(7) "Caritas"
}
}
[5]=>
array(4) {
["file"]=>
string(59)
"C:\www\ouced\live\modules\Ouced\src\class\FS\File.class.php"
["line"]=>
int(408)
["args"]=>
array(1) {
[0]=>
string(53)
"C:\www\ouced\live\modules\Ruh\config\basic.config.php"
}
["function"]=>
string(12) "include_once"
}
[6]=>
array(7) {
["file"]=>
string(58)
"C:\www\ouced\live\modules\Ouced\src\class\Module.class.php"
["line"]=>
int(60)
["function"]=>
string(11) "includeFile"
["class"]=>
string(13) "Ouced_FS_File"
["object"]=>
object(Ouced_FS_File)#6 (11) {
["directory":"Ouced_FS_File":private]=>
NULL
["filename":"Ouced_FS_File":private]=>
NULL
["filenameHash":"Ouced_FS_File":private]=>
NULL
["extension":"Ouced_FS_File":private]=>
NULL
["filesize":"Ouced_FS_File":private]=>
NULL
["accessTime":"Ouced_FS_File":private]=>
NULL
["modificationTime":"Ouced_FS_File":private]=>
NULL
["contents":"Ouced_FS_File":private]=>
NULL
["alias":"Ouced_FS_File":private]=>
NULL
["absolutePath"]=>
string(53)
"C:\www\ouced\live\modules\Ruh\config\basic.config.php"
["relativePath"]=>
string(35) "modules\Ruh\config\basic.config.php"
}
["type"]=>
string(2) "->"
["args"]=>
array(0) {
}
}
[7]=>
array(6) {
["file"]=>
string(57)
"C:\www\ouced\live\modules\Ouced\src\class\Ouced.class.php"
["line"]=>
int(164)
["function"]=>
string(14) "registerModule"
["class"]=>
string(12) "Ouced_Module"
["type"]=>
string(2) "::"
["args"]=>
array(2) {
[0]=>
string(3) "Ruh"
[1]=>
bool(true)
}
}
[8]=>
array(7) {
["file"]=>
string(57)
"C:\www\ouced\live\modules\Ouced\src\class\Ouced.class.php"
["line"]=>
int(223)
["function"]=>
string(8) "initCore"
["class"]=>
string(5) "Ouced"
["object"]=>
object(Ouced)#1 (0) {
}
["type"]=>
string(2) "->"
["args"]=>
array(0) {
}
}
[9]=>
array(7) {
["file"]=>
string(40) "C:\www\ouced\live\modules\Ouced\init.php"
["line"]=>
int(13)
["function"]=>
string(16) "startApplication"
["class"]=>
string(5) "Ouced"
["object"]=>
object(Ouced)#1 (0) {
}
["type"]=>
string(2) "->"
["args"]=>
array(0) {
}
}
[10]=>
array(4) {
["file"]=>
string(46) "C:\www\ouced\live\modules\Ruh\public\index.php"
["line"]=>
int(8)
["args"]=>
array(1) {
[0]=>
string(40) "C:\www\ouced\live\modules\Ouced\init.php"
}
["function"]=>
string(12) "include_once"
}
}
--
Edit bug report at https://bugs.php.net/bug.php?id=69081&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69081&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69081&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69081&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69081&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69081&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69081&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69081&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69081&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69081&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69081&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69081&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69081&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69081&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69081&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69081&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69081&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69081&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69081&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69081&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69081&r=mysqlcfg