Home » Php » php – PDO drivers no value in Windows

php – PDO drivers no value in Windows

Posted by: admin April 23, 2020 Leave a comment


The php_pdo_mysql.dll can’t be enabled in machine. I have set extension=php_pdo.dll and extension=php_pdo_mysql.dll enabled in php.ini, but when I checked phpinfo(), the item PDO drivers is no value.

and also I can’t find the mysql infos in phpinfo() but I have set extension=php_mysql.dll enabled.

What’s wrong ?

How to&Answers:

I had this same problem when I upgraded to PHP 5.4. I had

extension_dir = "ext"

in php.ini and php -m was starting fine and reporting that it loaded pdo_mysql, but when I ran phpinfo.php through apache, the driver was missing.

I fixed it by changing the extension_dir to an absolute path. I’m guessing it got confused when running through Apache and made it relative to something else.

; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
extension_dir = "D:/php-5.4.11-Win32-VC9-x86/ext"


try the following: look for this in your php.ini and uncomment extension_dir = “ext”

; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
 extension_dir = "ext"


Try php -m in console, it will show startup errors of PHP.


On an Windows Server 2012, Apache 2.4, php 5.4 installation, after trying everything else changing this worked…

PHPIniDir "C:\php\"


PHPIniDir "C:/php/"



Check with phpinfo() to ensure that the path for the php.ini is the same one being set. On Windows machines it is common for multiple instances of php.ini to be created and cause confusion.

Also, calling php from the command line will give you an error message with more details as to why it may not be loading. It might be that the extension that you are trying to include is not compatible with your PHP installation. i.e. it is a non thread safe dll with a thread safe binary or there is a compiler mismatch somewhere where vc9 and vc6 were both used.


In PHP 7.1 x64 on windows with apache 2.4 x64:

extension_dir = “ext”
doesn’t work for me,

absolute path:
extension_dir = “C:\DEV\PHP71\ext\”
worked well


After change the php.ini configuration, need to restart Appche server in windows service. Then the extension module will be loaded. use following code to test :<?php print_r(get_loaded_extensions());?>


I was having this problem on Windows using IIS. My php.ini contained the following sections:


I simply took the [PHP_PDO_MYSQL] and [PHP_PDO] sections, and swapped their positions, so that [PHP_PDO] came first. I guess declaration order is important!


Mihai’s comment in 2012 says: “Try php -m in console, it will show startup errors of PHP.” This suggestion proved to be most helpful. If there are any errors in the php.ini file, Windows PHP manager (IIS 8) is not very clear about what’s wrong with php.ini.

Go to the Command Prompt and type php -m at the prompt. A pop-up message (alert) will let you know about any errors AND it gives line numbers for those problems. In most cases, my only issue was that I had uncommented (removed the semi-colon) on a few php.ini lines where I should NOT have done so.

Another helpful tip for me was to put in the full path for the extensions folder, (see comment above by Jeremy Prine) which helped with the “missing dll” messages started popping up in the alert boxes.


I had the same issue, and was stumped until I read the following:


I am running PHP 5.2 with Apache 2.2. The fix for me was to copy the libmysql.dll file into my Apache bin directory.

I would recommend the following course of action to anyone having this issue:
1) check to make sure that loaded configuration file is where you think it is (i.e., that Apache is not using some default php.ini) – phpinfo() will provide the answer on this
2) check to make sure that all desired extensions are located in the php\ext folder and are included in the php.ini file (most popular extensions simply need to be uncommented)
3) Try to load pdo_sqllite. If this shows up in phpinfo() after restarting Apache, you’ve narrowed the problem to the inability of Apache to load the necessary mysql extensions.
4) Follow in instructions in the link above.


If you’re using PHP Manager with IIS, do the following:

  1. Open IIS (I usually open it by typing IIS in start);
    Start IIS

  2. Double-click “PHP Manager”;
    Click PHP Manager

  3. Click “Enable or disable an extension”;
    Enable/Disable extension

  4. Scroll down to find your driver of choice (in my case php_pdo_mysqll.dll), and click “enable”;
    Scroll to driver & enable

  5. After that the driver should show up, and work.
    Enabled driver

  6. Done! Hopefully this helped someone, because the other answers did not work for me.


PDO Drivers no value – your dll entries cannot orderized in php.ini file. Check the list of dll extension entries.


entries must be placed next to all pdo entries. Same as


entries must be placed next to all without pdo entries.

Hops it helps..


I got hints here:


I made sure that I set c:/php as a PATH variable and then moved the appropriate dlls into the c:/php directory (from the c:/php/ext directory).

All works for me now, though I’m not completely comfortable with moving things around the php directory.


I had this problem too. I have Apache/2.2.22 (Win32) PHP/5.3.23 on a Windows 7 machine. My solution was changing extension_dir = C:\Program Files (x86)\PHP\ext in the php.ini file to extension_dir = “C:\Program Files (x86)\PHP\ext”. It just needed adding the quotation marks.

I also added the php directory to the CLASSPATH.


check that pdo*.dll files are in appropriate locations in OS directory, check references for these files are enabled in php.ini, check your dbconnection string is correct, restart apache


PHP error PDO not exist on 5.4

Fatal error: Class ‘DigitalToolBox\PDO’ not found in C:\SERVER\www\MyAPP\DigitalToolBox\MysqlConnectionTool.php on line 19

you can see pdo is loaded because is in list with this comand:


this error happens for the use of namespaces, we need to add at the beginning of our code the instruction:

use PDO;

IF ($this->works)