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:
[Illuminate\Database\QueryException]
[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.
以上是PHP 7.0 上的 Laravel 5.4:为什么我会收到“无法找到驱动程序 (MySQL)”PDO 异常?的详细内容。更多信息请关注PHP中文网其他相关文章!