此适配器需要 PDO 扩展,但未加载扩展
问题描述
当我尝试使用 Zend_Db_Table_Abstract 类的 fetchall 方法时,出现以下异常...
I am getting the following exception when i try to use the fetchall method of the Zend_Db_Table_Abstract class...
我在php.ini文件中添加了以下几行
I have added the following lines in the php.ini file
我的系统中还安装了PDO MySQL 包.但我仍然收到上述异常......(还重新启动了Apache服务器)
Also i have The PDO MySQL package installed in my system. But still I am getting the above exception.... (Also restarted the Apache server)
推荐答案
首先,你不能同时拥有:
First of all, you cannot have both :
适用于 Linux,以及:
Which are for Linux, and :
哪些适用于 Windows:您必须选择,具体取决于您使用的系统.
Which are for windows : you've got to choose, depending on the system you are using.
在 Windows 上,您应该使用 .dll
版本.
As you are on windows, you should use the .dll
version.
但请注意,您使用了 :
But note that you used :
即您加载了 pdo_mssql
扩展——它用于 Microsoft SQL Server,而不是 MySQL.
i.e. you loaded the pdo_mssql
extension -- which is for Microsoft SQL Server, and not MySQL.
相反,您应该加载 MySQL 的扩展:
Instead, you should load the extension for MySQL :
更正后,重启Apache;情况应该会好转.
After correcting that, restart Apache ; and things should get better.
如果情况没有好转,您应该检查 phpinfo()
的输出:
- 在
phpinfo()
输出的开头,表示加载的是哪个php.ini
文件;确保你修改了正确的. - 检查,文件中是否有关于
pdo_mysql
的部分- 如果没有,请检查 Apache 的 error_log,以防万一;-)
- At the beginning of
phpinfo()
's output, it indicates whichphp.ini
file is loaded ; make sure you modified the right one. - Check, lower in the file, if there is a section about
pdo_mysql
- If not, check Apache's error_log, just in case ;-)
这篇关于此适配器需要 PDO 扩展,但未加载扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!