I'm getting extremely frustrated with Laravel 5 deployment...
Things seem to work fine if I install and follow the instructions according to the Forge tutorial on here.
However, due to my particular needs of running wordpress alongside my laravel project, I wanted to split up the site like this:
Place the laravel app under /home/default/app/
Place the wordpress installation under the default directory, or /home/default/
Therefore I manually SSH'd into the server, and cloned my directory into /home/default/app/
And I then updated the Laravel Forge deployment script to this:
cd /home/forge/default/app/
git pull origin master
composer install --no-interaction --no-dev --prefer-dist
php artisan migrate --force
This is the error I am receiving when trying auto-deploy:
[PDOException]
SQLSTATE[HY000] [1045] Access denied for user ''@'localhost' (using password: NO)
I set the environmental variables in Forge. My .env file is not uploaded to the repository... (included in .gitignore)
Assuming that it were, here is my .env file (which I strongly believe is not on my server):
APP_ENV=local
APP_DEBUG=true
APP_KEY=SomeRandomString
DB_HOST=localhost
DB_DATABASE=scheduleify
DB_USERNAME=root
DB_PASSWORD=secret
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
My database.php entries for the MYSQL server:
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST'),
'database' => env('DB_DATABASE'),
'username' => env('DB_USERNAME'),
'password' => env('DB_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
],
The Environmental Variable names in Forge:
DB_HOST
DB_USERNAME
DB_PASSWORD
DB_DATABASE
EDIT: Additional Information
Running the getenv command:
Current application environment: production
However, trying to get the environmental variables via php artisan tinker through SSH (is my syntax right?) reveals:
>>> env('DB_HOST');
=> null
Is there any way to diagnose what's wrong? Is there something I missed? Should I un-install the repository in Forge?