Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

penguinfeet's avatar

Laravel 5 Deployment on Laravel Forge

I am trying to deploy a fresh Laravel 5 project that I have working on my local environment with Homestead. However, when I try to deploy the project on Forge, I get this error:

[PDOException]
SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: NO)

I have a .env file in the project root that looks like this:

APP_ENV=local APP_DEBUG=true APP_KEY=******************************

DB_HOST=localhost DB_DATABASE=homestead DB_USERNAME=homestead DB_PASSWORD=secret

CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=sync

MAIL_DRIVER=smtp MAIL_HOST=mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null

Do I need to change this for production or add another .env file on the server? Thank you!

0 likes
3 replies
penguinfeet's avatar

So what values should I set in the environment tab on forge?

clin407's avatar

You'd need to set the DB_* in your second line above but you'd need to set the database username and password to what was given to you in your "Server Provisioned" email. At the minimum, you'd need to have something like this: http://chrisl.in/s/7477a7.png which basically writes to your .env (if you SSH in and look at the .env file, it should list all the variables in your environment tab).

Please or to participate in this conversation.