laravel – Can't run "php artisan migrate"-ThrowExceptions

Exception or error:

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?

How to solve:

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

Leave a Reply

Your email address will not be published. Required fields are marked *