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 not using real system env vars when they exist although specified in .env doc, but it works in a Command #54464
Comments
Update: When I remove the |
Maybe related to https://www.php.net/manual/en/ini.core.php#ini.variables-order ? 🤔 What is the value used via apache? Is it different from the value used on cli? |
I guess you mean the I've changed it back to the default Because I now know what to look for, it seems this issue is related to #45266. However, I couldn't find any documentation for it. Maybe add some documentation to https://symfony.com/doc/current/setup/web_server_configuration.html#apache ? [update]
Since symfony/dotenv uses |
An update to setting the
To run the testcases from inside the container I have to run it like: APP_ENV=test bin/phpunit I need to run the testcases from inside the container, because it's using several php extensions, which otherwise fail when these are not installed. |
You might want to try <env name="APP_ENV" value="test" force="true" /> |
If I replace <server name="APP_ENV" value="test" force="true" /> with <env name="APP_ENV" value="test" force="true" /> I got an error that the If I add them both like so: <server name="APP_ENV" value="test" force="true" />
<env name="APP_ENV" value="test" force="true" /> Then it's working as expected. However, this seems wrong to me. And all because I copied over the |
Symfony version(s) affected
5.4 -> 7.0
Description
When I specify a variable in
.env
file likeFOOBAR
and give it some default value. And I specify that same variableFOOBAR
as system variable in a docker container, it doesn't use the system variable. Although the documentation in the.env
file specifies:I can't seem to wrap my head around it, because on the command line it works perfectly fine.
Second when you run
bin/console debug:dotenv
the env variable specified on system level is not shown anymore. When I remove the system variable, it perfectly shows in thebin/console debug:dotenv
.Am I missing something? Or could anybody lead me to the correct documentation?
How to reproduce
Run a docker container with env
FOOBAR=system
.Now if you go to
http://localhost:[port]
you will see{"foobar":"default"}
. When you runbin/console app:debug
from within the container you will seesystem
.Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: