Bug #67808 [Opn->Wfx]: Env variables through the built-in server set in $_ENV but not in $_SERVER

From: Date: Sat, 05 Sep 2015 12:11:36 +0000
Subject: Bug #67808 [Opn->Wfx]: Env variables through the built-in server set in $_ENV but not in $_SERVER
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-195782@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67808&edit=1 ID: 67808 Updated by: cmb@php.net Reported by: morgan dot auchede at gmail dot com Summary: Env variables through the built-in server set in $_ENV but not in $_SERVER -Status: Open +Status: Wont fix Type: Bug Package: Built-in web server PHP Version: Irrelevant -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: I agree with Adam's assessment, so WONTFIX. Previous Comments: ------------------------------------------------------------------------ [2014-08-08 20:50:52] aharvey@php.net Honestly, my initial reaction to this is that CGI and FPM are wrong — I wouldn't support changing them (BC and all), but I don't think we need to be bug for bug compatible on the $_SERVER copying behaviour across SAPIs, either, given the documented method for accessing environment variables ($_ENV) works fine in all SAPIs in current versions. Not won't fixing this now in case someone else wants to weigh in, but that's my inclination. ------------------------------------------------------------------------ [2014-08-08 20:42:16] morgan dot auchede at gmail dot com Description: ------------ If we set an environment variable through Apache (or Nginx), the variable will be available in "$_ENV" and "$_SERVER". Unfortunately, if we set an environment variable through the built-in server, the variable will only be available in "$_ENV" (not in $_SERVER). See the original issue related: https://github.com/symfony/symfony/issues/10208 Test script: --------------- # test.php <?php var_dump($_ENV['FOO']); var_dump($_SERVER['FOO']); # bash export FOO="bar" php -d variables_order=EGPCS -S 0.0.0.0:8000 -t . test.php Expected result: ---------------- string 'bar' (length=3) string 'bar' (length=3) Actual result: -------------- string 'bar' (length=3) Notice: Undefined index: FOO ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67808&edit=1

« previous php.bugs (#195782) next »