-1

When I try to run "php artisan migrate" I get the following error:

Illuminate\Database\QueryException 

  could not find driver (SQL: PRAGMA foreign_keys = ON;)

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:669
    665|         // If an exception occurs when attempting to run a query, we'll format the error
    666|         // message to include the bindings with SQL, which will make this exception a
    667|         // lot more helpful to the developer instead of just the database's errors.
    668|         catch (Exception $e) {
  > 669|             throw new QueryException(
    670|                 $query, $this->prepareBindings($bindings), $e
    671|             );
    672|         }
    673| 

How can I fix it?

  • I'm guessing here, but it looks like a configuration issue. It would help if you posted the database section of your .env. – ryantxr Mar 16 '20 at 14:30
  • looks like you're using sqlite, if so make sure the php extension is installed. – Rabah Mar 16 '20 at 14:35

1 Answers1

1

I also faced same error and fixed with just one command Below that's because of missing extension you need to install php-sqlite3 extension

If you are using Ubuntu OS

Run:

sudo apt-get install php-sqlite3
Faizan Sadiq
  • 334
  • 2
  • 12