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.
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) 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.
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.
Eclipse: PDO could not find driver even though it's installed and enabled
Its not about php.ini
or anything related to that matter. You do not need to install anything or turn on stuff related to PDO when it comes to XAMPP, its installed and turned on already.
It's just you're not putting in the correct driver on the dsn:
$dns = "mysql:host=localhost;dbname=DataBase";
Just follow the format, no need for anything fancy.
mysql : dbname =DataBase; localhost
^ ^ // why do you need a space? what for?
Related Topics
Error Message "Strict Standards: Only Variables Should Be Passed by Reference"
Ajax Request Callback Using Jquery
How to Get Body of a Post in PHP
PHP Syntax For Dereferencing Function Result
Compiling an Ast Back to Source Code
How to Explain Composer'S Error Log
How to Get Id of the Last Updated Row in MySQL
Pdo MySQL: Use Pdo::Attr_Emulate_Prepares or Not
PHP Foreach Change Original Array Values
Send Email from Localhost Running Xammp in PHP Using Gmail Mail Server
Why Check Both Isset() and !Empty()
Sort an Array by Keys Based on Another Array
PHP Display Image Blob from MySQL
What Are the PHP Operators "" and ":" Called and What Do They Do