I have a Laravel application that is connected to a RDS db, in localhost it works perfectly but when I deploy the application into Elastic Beanstalk it stops working.
The connection to mysql:
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => 'dbpassword',
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
],
DB_CONNECTION=mysql
DB_HOST=dbname.ctwrtyncfghj.us-east-1.rds.amazonaws.com
DB_PORT=3306
DB_DATABASE=dbname
DB_USERNAME=dbUser
To deploy I compress all the files except for vendor/.