I have successfully deployed my laravel 5 app to AWS EC2. I have also created a MySQL database with AWS RDS and associated it with my app instance.
Now I want to set my
Russ Matney above gave the right answer, so he gets the checkmark. I'll write my own answer here to add in details on how I made things work. I assume you do have your database set up and have all the credentials you need.
1. Go to your elastic beanstalk dashboard
2. Next go to your software config
3. Add your production environment variables as shown below. Remember to set the doc root to /public, and also add :3306 at the end of your database end point to avoid the PDOEXCEPTION error.
See bigger version of picture below
4. Next SSH into your apps eb instance. See details here, or try the following below:
$ ssh -i path/to/your/key/pair/pem/file.pem ec2-user@ec1-11-11-11-111.eu-central-1.compute.amazonaws.com
Note the ec1-11-11-11-111.eu-central-1.compute.amazonaws.com is your apps public DNS. You'll find yours right here:
5. cd to your app: $ cd /var/app/current
6. Give read/write access to your storage folder or the app can't write to the logs folder and that'll result in an error when running the migrations. To give access: $ sudo chmod -R ugo+rw storage
7. Finally! Run your migrations and do other artisan commands if you please! $ php artisan migrate
Success should roughly look like this from gitbash: