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"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…