10

I am trying to get my ZEND application up on my apache server running on UNIX. Initially my host didnot give PDO support ,and i got it enabled by requesting them with a mail.But now I am getting an error saying The mysql driver is not currently installed

The stack trace is like:

An error occurred
Application error
Exception information:

Message: The mysql driver is not currently installed
Stack trace:

#0 /home/windchim/worminc/library/Zend/Db/Adapter/Abstract.php(770): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 /home/windchim/worminc/library/Zend/Db/Adapter/Abstract.php(840): Zend_Db_Adapter_Abstract->quote('aaditya258', NULL)
#2 /home/windchim/worminc/library/Zend/Auth/Adapter/DbTable.php(354): Zend_Db_Adapter_Abstract->quoteInto('`password` = MD...', 'aaditya258')
#3 /home/windchim/worminc/library/Zend/Auth/Adapter/DbTable.php(285): Zend_Auth_Adapter_DbTable->_authenticateCreateSelect()
#4 /home/windchim/worminc/library/Zend/Auth.php(117): Zend_Auth_Adapter_DbTable->authenticate()
#5 /home/windchim/worminc/application/controllers/LoginController.php(117): Zend_Auth->authenticate(Object(Zend_Auth_Adapter_DbTable))
#6 /home/windchim/worminc/library/Zend/Controller/Action.php(503): LoginController->processAction()
#7 /home/windchim/worminc/library/Zend/Controller/Dispatcher/Standard.php(285): Zend_Controller_Action->dispatch('processAction')
#8 /home/windchim/worminc/library/Zend/Controller/Front.php(934): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#9 /home/windchim/public_html/worm/index.php(47): Zend_Controller_Front->dispatch()
#10 {main}

How can this be resolved? Please help

4

5 回答 5

17

PDO, unlike the mysql_* functions, supports a number of database engines. To do this it needs a driver library for each one.

You have the "core" of PDO installed but not the MySQL driver - just get that installed (called pdo_mysql) and everything will be OK.

Your php.ini should have one of these (windows or linux):

extension=php_pdo_mysql.dll
extension=php_pdo_mysql.so
于 2009-07-12T09:46:37.923 回答
5

在 php.ini 文件中,您只需启用以下行 extension=php_pdo_mysql.dll (意味着删除它前面的注释)

那么它将被正确执行。

于 2010-11-06T15:55:06.477 回答
4

正如其他人所提到的,您需要启用 pdo_mysql 扩展。

但是,在我的机器(Windows 7)上将 php(5.3)作为 apache(2.2)模块运行,它仍然无法工作。我发现 php.ini 中的 extension_dir 值需要使用绝对路径设置(相对路径不起作用)!

希望这对你们中的一些人有所帮助!

于 2012-05-17T17:16:27.063 回答
0

mysql扩展已被弃用,并在 php7 中完全删除

你应该检查php-mysql包裹。如果尚未安装,请运行sudo apt-get install php-mysql

于 2021-04-02T08:07:33.083 回答
-2

Fi 检查 error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT 的拼写(在生产阶段应该是这样的)

如果你输入 error_reporting (value); 或类似的东西(通常用于测试,“值”可能是“0”)

如果您使用,您可能会收到此错误“当前未安装 mysql 驱动程序”

所以 php.ini 中的任何语法错误都可能产生这个错误。如果您始终仔细设置系统,您可能会很容易感到困惑,因为您知道,数据库安装或设置没有错误。如果其他一切都是正确的,那么请在 php.ini 中查找语法错误。

于 2015-02-16T21:22:50.040 回答