0

I want to make a migration to database.sqlite, but i get the following error while trying to execute a migration: enter image description here

     'default' => env('DB_CONNECTION', 'database.sqlite'),
      DB_CONNECTION=sqlite
      REDIS_HOST=127.0.0.1
      REDIS_PASSWORD=null
      REDIS_PORT=6379

And the database.sqlite file has a text file type. I am using ubuntu 16.04lts and phpstorm.

Daniel Santos
  • 429
  • 5
  • 15
  • Try installing SQLite, `apt install php7.0-sqlite3` – Lawrence Cherone Aug 26 '17 at 16:35
  • 1
    Possible duplicate of [pdo exception driver not found in laravel for sqlite](https://stackoverflow.com/questions/38949781/pdo-exception-driver-not-found-in-laravel-for-sqlite) – Don't Panic Aug 26 '17 at 16:35
  • 1
    There are many duplicates of this question - [example 1](https://stackoverflow.com/questions/38949781/pdo-exception-driver-not-found-in-laravel-for-sqlite), [example 2](https://stackoverflow.com/questions/26485331/laravel-login-from-sqlite-db-getting-pdoexception-could-not-find-driver), [example 3](https://stackoverflow.com/questions/8803728/pdo-sqlite-could-not-find-driver-php-file-not-processing) ... – Don't Panic Aug 26 '17 at 16:37
  • I installed sqlite3 successfuly but it does not fix it, i am using php 7.1.8 though, i tried 7.1-sqlite3 but it doesn't work. – Daniel Santos Aug 26 '17 at 16:40
  • did you check if sqlite is enabled in your `php.ini` file ? – jaysingkar Aug 26 '17 at 17:35
  • The problem is fixed, i was editing example.env not env file, and also 'default' => env('DB_CONNECTION', 'database.sqlite'), is wrong, instead i changed to: default' => database_path('database.sqlite'). But for some reason laravel creates the first one instead of the second. Thanks for the replies. – Daniel Santos Aug 26 '17 at 17:53

1 Answers1

0

The problem is fixed, i was editing example.env not the real env file, and also, on the database.php file, i had 'default' => env('DB_CONNECTION', 'database.sqlite'), and changed it to: default' => database_path('database.sqlite'). I just don't know why laravel sets it up as the first one.

Daniel Santos
  • 429
  • 5
  • 15