I\'m trying to run a PHP script that is triggered by a cron script (in cron.d). The script is triggered properly but it is missing the Elastic Beanstalk \"Environment Variab
I just found this, using
grep -r "export MY_VAR" /
EDIT: Amazon seems to move the file location from time to time. Current location is:
/opt/elasticbeanstalk/support/envvars
So I think I'll just include (source [file path]) that in my script before calling my php script. Still seems like a funky way to do things. I'm still in for better solutions.
I was running PHP via bash script triggered by cron. So to setup the environment, I would do something like this:
#!/bin/bash
source /opt/elasticbeanstalk/support/envvars
php -f my-script.php
See @userid53's answer below for PHP solution.