11

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

Charles
  • 50,943
  • 13
  • 104
  • 142
Arc
  • 1,680
  • 6
  • 30
  • 57

5 Answers5

19

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
Greg
  • 316,276
  • 54
  • 369
  • 333
  • Do i need to get something installed or just an entry to the php.ini? – Arc Jul 12 '09 at 09:51
  • 1
    @Arkid: Your hosting provider will probably need to install the separate MySQL PDO driver module and ensure that it's enabled in the PHP configuration. – Rob Jul 12 '09 at 10:01
  • If you're adding extensions in single file manually, remember to load pdo.so before pdo_mysql.so, otherwise it doesn't work. – Mika Vatanen Oct 26 '16 at 10:13
5

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.

Azhar Ahammed
  • 51
  • 1
  • 1
4

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!

djule5
  • 2,722
  • 2
  • 19
  • 19
1

mysql extension was deprecated and is totally removed in php7

You should check php-mysql package. If not yet install, let run sudo apt-get install php-mysql

Kieu Trung
  • 159
  • 1
  • 7
-2

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.