Zend 应用程序未安装 MySql 驱动程序错误
我正在尝试在 UNIX 上运行的 apache 服务器上启动我的 ZEND 应用程序。 最初我的主机没有提供 PDO 支持,我通过邮件请求他们启用了它。但现在我收到一条错误消息,提示 The mysql driver is not current install
堆栈跟踪如下:
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这能解决吗? 请帮忙
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
与 mysql_* 函数不同,PDO 支持多种数据库引擎。
为此,每个驱动程序都需要一个库。
你已经安装了 PDO 的“核心”,但没有安装 MySQL 驱动程序 - 只要安装它(称为 pdo_mysql),一切都会好起来的。
您的 php.ini 应该具有以下之一(Windows 或 Linux):
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):
在 php.ini 文件中,您只需启用以下行
extension=php_pdo_mysql.dll(意思是去掉前面的注释)
就可以正确执行了。
In php.ini file u just enable following line
extension=php_pdo_mysql.dll (means remove comments in front of it)
then it will be executed Correctly.
正如其他人提到的,您需要启用 pdo_mysql 扩展。
然而,在我的机器(Windows 7)上将 php (5.3) 作为 apache (2.2) 模块运行,它仍然无法工作。 我发现 php.ini 中的 extension_dir 值需要使用绝对路径设置(相对路径不起作用)!
希望这对你们中的一些人有所帮助!
As others have mentionned, you need to enable the pdo_mysql extension.
However, running php (5.3) as an apache (2.2) module on my machine (windows 7), it still wouldn't work. I figured out the extension_dir value in php.ini needs to be set using an absolute path (relative just wouldn't work)!
Hope this helps some of you!
mysql
扩展已被弃用,并在 php7 中被完全删除。您应该检查
php-mysql
软件包。 如果尚未安装,请运行sudo apt-get install php-mysql
mysql
extension was deprecated and is totally removed in php7You should check
php-mysql
package. If not yet install, let runsudo apt-get install php-mysql
Fi 检查拼写
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
(在生产阶段应该是这样)
如果你输入
错误报告(值);
或类似的东西(通常用于测试,“值”可能是“0”)
你可能会得到这个错误
“当前未安装 mysql 驱动程序”
如果您使用
php.ini 中的任何语法错误都可能会生成此错误。
如果您始终小心地设置系统,您可能很容易感到困惑,因为您知道,数据库安装或设置没有错误。
如果其他一切都正确,请查找 php.ini 中的语法错误。
F.i. check spelling of
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
(should be like this at production stage)
If you type
error_reporting (value);
or something like this (usually for testing, "value" might be "0")
you may get this mistake
"The mysql driver is not currently installed"
if you use
So any Syntax Error within the php.ini might generate this mistake.
If you setup your system carefully always you might get confused easily, because you know, there are no mistakes at db installation or settings.
If everthing else is correct, so go for a syntax error in php.ini.