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中文網其他相關文章!