Home >Database >Mysql Tutorial >Laravel 5 PDOException: How to Solve 'Could Not Find Driver'?
Laravel 5 PDOException Could Not Find Driver [solution]
When encountering a "PDOException: could not find driver" error in Laravel 5, it's necessary to install the correct database driver for your system. This issue arises when the PHP extension for the database you're using is missing.
Specifically, if you're connecting to MySQL, the following command will resolve the problem:
sudo apt-get install php7.0-mysql
This command will install the PHP MySQL module, which provides the required driver for Laravel 5 to connect to MySQL databases successfully.
Once the module is installed, restart your web server (e.g., Apache or Nginx) and reattempt database operations. The error should now be resolved, and Laravel 5 should be able to access your MySQL database without issues.
The above is the detailed content of Laravel 5 PDOException: How to Solve 'Could Not Find Driver'?. For more information, please follow other related articles on the PHP Chinese website!