I am deploying a Laravel application to the ElasticBeanstalk. Now, I am trying to SSH into the EC2 instance of my Beanstalk environment and run a command.
php artisan migrate --force
But I cannot run it. The command is failing because it is not getting the environment variables set in the Beanstalk Environment. Here is what I did.
I ssh into the instance. Then I go to the /var/www/html folder. Then I run the "php artisan migrate --force" command. As I mentioned it is failing because it is not getting the database credentials set in the Beanstalk environment. I also tried this.
sudo -u root php artisan migrate --force
The same thing happened. I also played around with tinker in the terminal. When I retrieve the app name like env('APP_NAME'), it is returning null. What is the issue and how can I fix it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…