Home >Backend Development >PHP Tutorial >Laravel 5 Migration Error: How to Fix the \'Could Not Find Driver\' Issue?

Laravel 5 Migration Error: How to Fix the \'Could Not Find Driver\' Issue?

Susan Sarandon
Susan SarandonOriginal
2024-11-26 17:20:14293browse

Laravel 5 Migration Error: How to Fix the

Laravel 5 PDOException: Could Not Find Driver

Running the "php artisan migrate" command in Laravel 5 throws a "could not find driver" error. This issue persists even when the application is running, resulting in database connection problems.

Solution:

The issue arises due to missing MariaDB or MySQL database extension in your PHP environment. To resolve this, run the following command in your terminal:

sudo apt-get install php7.0-mysql

This command will install the necessary PHP extension for MySQL connectivity. Restart your application or server after the installation is complete to apply the changes.

The above is the detailed content of Laravel 5 Migration Error: How to Fix the \'Could Not Find Driver\' Issue?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn