PDO驱动程序在Windows中没有价值 [英] PDO drivers no value in Windows
问题描述
无法在计算机中启用php_pdo_mysql.dll
.我已经在php.ini中设置了extension=php_pdo.dll
和extension=php_pdo_mysql.dll
启用,但是当我选中phpinfo()
时,项目 PDO驱动程序是没有值.
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.
,我也无法在phpinfo()中找到mysql信息,但我已启用extension=php_mysql.dll
设置.
and also I can't find the mysql infos in phpinfo() but I have set extension=php_mysql.dll
enabled.
怎么了?
推荐答案
升级到PHP 5.4时,我遇到了同样的问题.我有
I had this same problem when I upgraded to PHP 5.4. I had
extension_dir = "ext"
php.ini和php -m
中的
正常运行,并报告它已加载pdo_mysql,但是当我通过apache运行phpinfo.php时,驱动程序丢失了.
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.
我通过将extension_dir
更改为绝对路径来修复它.我猜想它在通过Apache运行时会感到困惑,并使它相对于其他东西.
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"
这篇关于PDO驱动程序在Windows中没有价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!