-
-
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
[Dotenv] Loading of env variables depends on the php parameter variables_order
#45266
Comments
If which SAPI does this happen? |
We could fix that in symfony/runtime maybe. |
haven't used
I've built a docker image based on official php 8.1-apache With the
and the correct env variable value will be, later in the same method, overwritten with the value read in from the .env.local.php at lines symfony/src/Symfony/Component/Dotenv/Dotenv.php Lines 198 to 201 in 43e3e71
This is the commit that removed the edit symfony/src/Symfony/Component/Dotenv/Dotenv.php Lines 139 to 141 in 08291b1
|
that's what I would say also... so it's something else I guess |
Closing for now, please report back when you have more info. |
Thanks for the hint about I was having issues after enabling the php.ini-production. Real environment variables were not resolved correctly: I was using the following environment variable:
Our application tried to connect to |
Symfony version(s) affected
^5.4, most possibly others
Description
Loaded env vars are not the same depending on the
variables_order
parameter setting.The recommended development/production setting does not load the
$_ENV
superglobal. see: https://github.com/php/php-src/blob/master/php.ini-production#L636-L647When the
$_ENV
is not loaded the actual env variables are not considered and that breaks this stance in configuration documentationPossible cause for the issue is this change (it removed the call to
getenv
) f76e420#diff-2585c97d75081932a10834cb311d918012a7e0588d28ebd5216c8591b15d15aeL73How to reproduce
variables_order = "GPCS"
andvariables_order = "EGPCS"
Possible Solution
utilize
getenv
to load the variable, investigate other solutions for the rootcause of #23502Additional Context
No response
The text was updated successfully, but these errors were encountered: