a.badawi
a.badawi

Reputation: 23

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

UPDATE: I figured out what's going out, The PHP server that I use run my electron app seems not loading pdo_sqlite extension while the global php executable on my system works when I execute "php artisan migrate" from the command line. So that there is a mismatch with those two PHP versions.

I ran into a strange issue after switching to my new device. The artisan command migrate is working but when I try to access a page that connect to the database I got this error "could not find driver (SQL: PRAGMA foreign_keys = ON;)"

My configuration are as shown below
Laravel 8.40
PHP 7.3 with enabled extensions

Upvotes: 1

Views: 7371

Answers (2)

Othmane El Banin
Othmane El Banin

Reputation: 1

For those using windows;

Navigate to the php.ini file (C:\php\php.ini)

Enable the following by removing the semicolons:

;extension=pdo_sqlite
;extension=sqlite3

So they should look like this:

extension=pdo_sqlite
extension=sqlite3

Upvotes: 0

Felix Coker
Felix Coker

Reputation: 61

sudo apt-get install php-sqlite3

Upvotes: 6

Related Questions