Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Couldn't locate driver named mysql in doctrine php

My application was working perfectly on localhost. But when i uploaded the application on server i got an error. I made a test file to check databse connection, this is the error i am getting. Please hellp me how to fix this..

Fatal error: Uncaught exception 'Doctrine_Connection_Exception' with message 'Couldn't locate driver named mysql' in /hermes/web05/b1392/moo.fanyer/httpdocs/doctrine/lib/Doctrine/Connection.php:492 Stack trace: #0 /hermes/web05/b1392/moo.fanyer/httpdocs/doctrine/lib/Doctrine/Connection/Mysql.php(101): Doctrine_Connection->connect() #1 /hermes/web05/b1392/moo.fanyer/httpdocs/doctrine/lib/Doctrine/Connection.php(1008): Doctrine_Connection_Mysql->connect() #2 /hermes/web05/b1392/moo.fanyer/httpdocs/doctrine/lib/Doctrine/Query/Abstract.php(1094): Doctrine_Connection->execute('SELECT u.id AS ...', Array) #3 /hermes/web05/b1392/moo.fanyer/httpdocs/doctrine/lib/Doctrine/Query/Abstract.php(1142): Doctrine_Query_Abstract->_execute(Array) #4 /hermes/web05/b1392/moo.fanyer/httpdocs/doctrine/models/Users.php(22): Doctrine_Query_Abstract->execute() #5 /hermes/web05/b1392/moo.fanyer/httpdocs/test.php(8): Users->get_details_username('mohit') #6 {main} thrown in /hermes/web05/b1392/moo.fanyer/httpdocs/doctrine/lib/Doctrine/Connection.php on line 492

Edit: how to enable my sql drivers..???

like image 419
Mohit Jain Avatar asked Dec 11 '09 11:12

Mohit Jain


3 Answers

apt-get install php5-mysql ---------------

like image 70
user1077220 Avatar answered Sep 18 '22 21:09

user1077220


Enable pdo_mysql in the php.ini file

like image 23
krishna Avatar answered Sep 20 '22 21:09

krishna


Make sure that:

  • mysql extension is enabled on the server where you have uploaded files.
  • you have specified the correct paths.
  • there are no directory permission issues
like image 45
Sarfraz Avatar answered Sep 21 '22 21:09

Sarfraz