I am working on Laravel 8 project, I ran migrations and made models, resource controller, routes and views. After running project with routing, "could not find driver" error was appeared. Can anyone help me to solve this problem?
3 Answers
It seems like you have a missing dependency. run these commands
composer update
composer require doctrine/dbal
second solution: Edit your php.ini .Find and uncomment the following line (remove the ; character)
;extension=pdo_mysql.so //uncomment this line just remove ;
1 Comment
Seems like your database driver is missing.
What you can do is: First install the driver
For ubuntu and mysql database.
sudo apt-get install php7.x-mysql
Minimum is php7.3 as that is the minimum requirement for laravel 8.
You also can search for other database systems. To search for available driver in your machine/server:
sudo apt-cache search drivername
Then run the command
php artisan migrate
Comments
If your php version is correct then
Need to open php.ini file.
uncomment extension=pdo_mysql.so; by removing the # in the beginning
Then, restart your Apache server. For more information, please read the documentation.