For some reason, my laravel authoring application considers it to be in a local environment.
/var/www/appname/.env.php
<?php return [ 'APP_ENV' => 'production', 'DB_HOST' => 'HIDDEN', 'DB_NAME' => 'HIDDEN', 'DB_PASSWORD' => 'HIDDEN' ];
/var/www/appname/bootstrap/start.php
$env = $app->detectEnvironment(function() { return getenv('APP_ENV') ?: 'local'; });
/var/www/appname/app/config/database.php
... ... 'mysql' => array( 'driver' => 'mysql', 'host' => getenv('DB_HOST'), 'database' => getenv('DB_NAME'), 'username' => getenv('DB_USERNAME'), 'password' => getenv('DB_PASSWORD'), 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => 'lar_', ), ... ...
sudo php artisan env (via SSH)
`Current application environment: local
php artisan tinker , then getenv('DB_NAME')
$ php artisan tinker [1] > getenv('DB_NAME'); // false
So either my environment variables are not set, or Laravel does not recognize my .env.php file for the production environment.
Update
With some help from Anultro in IRC, it looks like .env.php is not loaded yet. Because such an APP_ENV must be set before laravel tries to discover the environments. This makes sense because Laravel needs to know which environment is running before deciding whether to use .env.php or .env.local.php .
Having said that, .env.php should still be used to store db credentials and private keys, etc. But I still have a problem, because the application still returns false when I try to run getenv('DB_NAME')
Any suggestions?