Set External Parameters using PHP Built-In Server #10208
Labels
Good first issue
Ideal for your first contribution! (some Symfony experience may be required)
HttpKernel
Hello,
I have found an issue with setting parameters externally (as explained on the "How to Set External Parameters in the Service Container" page) using PHP 5.4's built-in server.
If you refer to this StackOverflow question and this GitHub issue, you can see that the variables-order INI directive must be set to include "E" so that you can set environment variables like so:
This works fine, and
SYMFONY__DATABASE__PASSWORD
can be accessed viagetenv('SYMFONY__DATABASE__PASSWORD')
and$_ENV['SYMFONY__DATABASE__PASSWORD']
.The problem is,
$_ENV
and$_SERVER
$_ENV
but not in$_SERVER
The variables-order INI directive documentation contains the following warning:
The Symfony HttpKernel will only load the environment variables if they exist in $_SERVER, and not if they exist in $_ENV.
See the getEnvParameters() method in src/Symfony/Component/HttpKernel/Kernel.php.
If $_ENV was included in this method, I believe this would resolve the issue.
If there is an alternative solution, please let me know! :)
Cheers,
Ryan
The text was updated successfully, but these errors were encountered: