-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set External Parameters using PHP Built-In Server #10208
Comments
a simple check |
…r built-in server (mauchede) This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #10914). Discussion ---------- [HttpKernel] added an analyze of environment parameters for built-in server | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | no | Fixed tickets | #10208 | License | MIT | Doc PR | - With the built-in server, it is not possible to use the external parameters: environment variables are only in `$_ENV`. Commits ------- 696b978 [HttpKernel] added an analyze of environment parameters for built-in server.
Awesome thanks for the fix @fabpot! |
Is there a reason why the To work around the PHP issue with
I would prefer using |
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: