We are deploying a Laravel-based application to AWS using OpsWorks. We have defined environment variables through the OpsWorks console and they are correctly seen by Apache. However, when running CLI tasks such as artisan
commands, they are not set.
I understand this is due to environment variables being set on Apache's virtual host configuration files. I thought I could fix the issue by running a deploy hook that echoes these variables and appends them to /etc/environment
, but this does not work (and even if it did, it would be unbelievably weak).
Is there any other way to achieve this? Does OpsWorks allow this specific requirement?
Thanks.