Maison > Article > base de données > Comment corriger l'erreur « Impossible de trouver le pilote » dans Laravel sur Ubuntu 14.04 avec PHP 7.0 ?
Could Not Find Driver Error in Laravel on Ubuntu 14.04 with PHP 7.0
Problem:
When running php artisan migrate in a Laravel 5.4 application, the following error is encountered:
[Illuminate\Database\QueryException] could not find driver (SQL: select * from information_schema.tables where table_schema = pmaramaldb and table_name = migrations) [PDOException] could not find driver
Investigation:
Initial troubleshooting steps, including checking PDO extension status, installing php7.0-mysql, and trying composer dump-autoload, have not resolved the issue.
Solution:
The error is likely related to a missing dependency. To resolve it, check that php7-mysql is installed. Run the following command:
sudo apt install php7.0-mysql
If you prefer to install the latest version of the package, use this command:
sudo apt install php-mysql
Restart the Apache service afterwards. This should rectify the "could not find driver" error and allow migrations to run successfully.
Ce qui précède est le contenu détaillé de. pour plus d'informations, suivez d'autres articles connexes sur le site Web de PHP en chinois!