user3339595
user3339595

Reputation: 1

Laravel Artisan Migrate Error

I'm having a problem when running a migration. The error is:

{"error":{"type":"ErrorException","message":"Undefined index: DB_HOST","file":"/var/www/blog.dev/app/config/database.php","line":57}}

Upvotes: 0

Views: 950

Answers (1)

henrik
henrik

Reputation: 1618

You need to create a local config file for your local environment. Create a folder in app/config (laravel 4) and name it YOUR_FOLDER_NAME. THen edit /bootstrap/start.php for laravel 4 :

$env = $app->detectEnvironment(array(
  'YOUR_FOLDER_NAME' => array('YOUR_HOSTNAME'),
));

Then copy database.php which is located under app/config/ and paste in to YOUR_FOLDER_NAME. Then you edit this file that you pasted with your local configs. This will make all the configs in YOUR_FOLDER_NAME overwrite global app configs located in app/config.

Upvotes: 1

Related Questions