Closed bramstroker closed 5 years ago
@bramstroker thanks for reporting! Can you please test this patch: https://github.com/pimcore/pimcore/commit/f0abc8c5ca78216d1caf228adac337b6dbc9617a.patch ?
Thanks for a quick feedback!
@brusch Yes this patch is working correctly for me. Thanks for the quick resolution!
Hello Can anyone guide me on how the patch can be installed
@rajesh17692 While waiting for the patch to be implemented into Pimcore, you can install Composer Patches and then follow the instructions for External patches (or download it and use the instructions for internal).
Bug Report
Expected behavior
Pimcore is run in with the environment I define is my DotEnv file
Actual behavior
Pimcore environment is set to
prod
Steps to reproduce
Add the following to
.env
file in pimcore root folder:Add a breakpoint to line after
prepareEnvVariables
call inBootstrap.php
and inspect$_ENV
contents.PIMCORE_ENVIRONMENT
should bedev
but isprod
.This is an issue with Pimcore 6.0.4. In pimcore 6.0.1 everything was working as expected.
Possible cause of issue.
In one of the latest commits
$_ENV['PIMCORE_ENVIRONMENT']
is set hard in the code before$dotEnv->loadEnv()
is called. DotEnv by default does NOT override existing environment variables, so there is no way to override it with the dot env file anymore.