By your config I'm guessing you are using laravel 4.2.
In order for your environment to work you should create a .env.local.php in the laravel root folder.
The environment detection is made like this:
Please not you should never create a .env.testing.php file. That one is reserved. When running unit tests, Laravel automatically sets the environment to "testing"
Your .env.local.php file should look like this:
return [
'DB_HOST' => 'db.example.com',
'DB_NAME' => 'database_name',
'DB_USER' => 'database_username',
'DB_PASSWORD' => 'database_password'
];
I tried to do this (though I don't understand the sub folder config files then??) But it still complains about these variables are unset?
I have read again you question
It's impossible for me to create configuration for my local environment, because Laravel keeps complaining that the production environment variables are empty and invalid.
Try running php artisan env in the terminal. That should tell you the detected environment
It gives me the same error
php artisan env
{"error":{"type":"ErrorException","message":"Undefined index: DB_HOST","file":"\/Applications\/XAMPP\/xamppfiles\/htdocs\/project\/app\/config\/database.php","line":57}}
I don't know if it can be XAMPP or something that crashes everything.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community