PDOException “could not find driver”
You need to have a module called pdo_mysql. Looking for following in phpinfo(),
pdo_mysql
PDO Driver for MySQL, client library version => 5.1.44
Laravel: PDOException: could not find driver
You might need to comment out the following in your php.ini file.
;extension=pdo_mysql.so
Taken from this post:
Laravel 5 PDOException Could Not Find Driver
. I think I had to do something exactly like this when setting up laravel on digital ocean.
php - PDOException could not find driver
Remove the ;
from before the ;extension=php_pdo.dll
. And also from before other pdo
extensions. If you want to use those. And then restart the server.
The ;
actually comments a line in ini
files. So, you have to un-comment those lines to use them.
Edit: Instead of going through all of this trouble, you can instead use Xampp
or Wamp
or EasyPHP
or something.
Laravel 5 PDOException Could Not Find Driver
You should install PDO on your server.
Edit your php.ini (look at your phpinfo()
, "Loaded Configuration File" line, to find the php.ini file path).
Find and uncomment the following line (remove the ;
character):
;extension=pdo_mysql.so
Then, restart your Apache server.
For more information, please read the documentation.
PDOException::(could not find driver) PHP Configuration MySql
Finally was able to figure it out my self. While changing configuration in php.ini file which is in xampp folder I also modified the file in php installed location .ini file. reverting back the changes worked.
PHP Fatal error: Uncaught PDOException: could not find driver
To use different drivers you need to install them.
On Windows you simply uncomment a line in php.ini:
extension=php_pdo_mysql.dll
On Debian or similar Linux distribution you can just install the extension with the package manager:
sudo apt update
sudo apt install php7.1-mysql
Remember to install the correct version.
PDOException “could not find driver” in php
Hope you are running your project in localhost. In your project folder app/config a file named parameters.ini , Make sure that your Mysql database connection cofiguration is correct. If you are using mysql See database_driver=pdo_mysql
is its driver.
Below is an example.
database_driver = pdo_mysql
database_host = localhost
database_port =
database_name = databasename
database_user = msqlusername
database_password = mysqlpassword//if not make blank
mailer_transport = smtp
mailer_host = localhost
mailer_user =
mailer_password =
locale = en
secret = ThisTokenIsNotSoSecretChangeIt
Hope it helps you.
Related Topics
Enabling 'Strict_Types' Globally in PHP 7
Keeping Url Parameters During Pagination
How to Output in Cli During Execution of PHP Unit Tests
Getting the Value of an Extra Pivot Table Column Laravel
How to Get CSV File to Download on Ie? Works on Firefox
How to Listen to a Tcp Port Using PHP
How to Add Paths to the Apache Path Variable
PHP Method Argument Type Hinting with Question Mark (Type)
Continuing Overflowed Text in a Different Div