PDO drivers no value in Windows

Solution 1:

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"

Solution 2:

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"