I’m currently trying to setup ExpressionEngine to run off environment files as per the documentation. I seem to be having trouble getting my config file to pickup the .env.php settings on my install.
Anything specific I should do?
That is not my experince. I have my .env.php at the same level as my system directory. I can then access any value, for example MY_ENV_VALUE=test in my config files by using $_ENV[‘MY_ENV_VALUE’]
What is really cool is that you can inject that into the config object $config[‘custom_value’] = $_ENV[‘MY_ENV_VALUE’]; and then reference that in your custom add on code like this ee()->config->item(‘custom_value’).
This kind of pattern makes multi environment setups a breeze. You can die and dump $_ENV at the top of your config file to ensure you are getting what you expect.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.