Home > Enterprise >  Illuminate\Database\QueryException could not find driver Laravel
Illuminate\Database\QueryException could not find driver Laravel

Time:06-10

I deploy a laravel project on an apache server on a Debian 10 machine. The database is an MySQL deployed on another debian 10 machine on the same network.

I can go to the connection interface of the application but when I connect this error appears :

Illuminate\Database\QueryException
could not find driver (SQL: select * from `users` where `email` = [email protected] limit 1)

I have already tried these commands :

php artisan migrate
sudo apt install php-mysql
sudo apt install php7.4-mysql
sudo systemctl restart apache2
composer require doctrine/dbal
composer update

these commands work but do not solve the problem.

and I already tried to comment and uncomment this line in the php.ini :

extension=pdo_mysql

in php-m i have PDO and pdo-mysql

and i have restart my server with :

systemctl restart apache2

after modification

CodePudding user response:

I got the same error when running my test suite. It was working before but it stopped working after I upgraded php. So I did and it worked for me.

sudo apt-get install php-sqlite3

CodePudding user response:

If you have no problem using php artisan migrate, there is no problem for the command line to call the php script. If you use fpm and install a new extension, you need to restart it and try.

  • Related