I have the same issue here. I have a reference image http://prntscr.com/7um7u5. Taylor said me: I would suggest including the DotEnv library used by Laravel 4 into your Laravel 5 project (https://github.com/vlucas/phpdotenv). You can load the .env file in your bootstrap/start.php file or similar. This will let you use the convenience of the new environment features while still using Laravel 4.
Environment variables doesn't working on Forge
I have deployed one Laravel 4.2 app on Forge before and everything works fine. I use environment variable to get database connection info like this:
'host' => getenv('db_host'),
'database' => getenv('db_name'),
'username' => getenv('db_username'),
'password' => getenv('db_password'),
But today I try to deploy a new app(Laravel 4.2 on AWS EC2), using the same code above and setting the environment variable on Forge.
During the migration step, it shows the error: [PDOException] SQLSTATE[HY000] [1045] Access denied for user ''@'localhost' (using password: NO)
I ssh into the server and run
php artisan env
It shows the right environment:
Current application environment: production
It looks link the environment variable that I set on Forge is not configured correctly on the server.
Any way to fix this?
Thank you!
Please or to participate in this conversation.