Home >Database >Mysql Tutorial >Laravel 5.4 on PHP 7.0: Why Am I Getting a 'Could Not Find Driver (MySQL)' PDO Exception?
Laravel 5.4 on PHP 7.0: Resolving "Could not find driver (MySQL)" PDO Exception
Issue Overview
When attempting to migrate a database using Laravel 5.4 on Ubuntu 14.04 with Plesk 12.5.30 and PHP 7.0, the following exceptions are encountered:
[IlluminateDatabaseQueryException]
[PDOException]
Troubleshooting
The following solutions have been attempted without success:
Enabling PDO Extension:
Installing php7.0-mysql:
Installing php5-sqlite:
Running composer dump-autoload:
Alternative Solution
Ensure that php7-mysql is installed. Run the following command:
sudo apt install php7.0-mysql
If Automatic Installation is Preferred:
sudo apt install php-mysql
This should resolve the "could not find driver (MySQL)" PDO exception in Laravel 5.4 with PHP 7.0.
The above is the detailed content of Laravel 5.4 on PHP 7.0: Why Am I Getting a 'Could Not Find Driver (MySQL)' PDO Exception?. For more information, please follow other related articles on the PHP Chinese website!