AWS Elastic Beanstalk: Running Cron.d script, missing Environment Variables

前端 未结 9 1211
没有蜡笔的小新
没有蜡笔的小新 2021-01-17 10:39

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

9条回答
  •  爱一瞬间的悲伤
    2021-01-17 11:02

    It's works for me with a Laravel Project

    * * * * * root . /opt/elasticbeanstalk/support/envvars && /usr/bin/php /var/www/html/artisan schedule:run 1>> /dev/null 2>&1
    

    For a non Laravel Project you can test that:

    * * * * * root . /opt/elasticbeanstalk/support/envvars && /usr/bin/php /path/to/your/script.php 1>> /dev/null 2>&1
    

    Hope this helps!

提交回复
热议问题