CDbConnection error in Yii

Whenever I try to log into the Yii app, it shows an error like

CDbConnection failed to open the DB connection: could not find driver . 

I googled for many hours, and from many blogs I knew that I needed pdo_mysql, but this is already installed. In php.ini I also commented on these lines

 ;extension=php_pdo_mysql.dll ;extension=php_mysql.dll 

and restarted the Apache server, but still showing the same problem. I am using ubuntu 11.04. Please help me resolve this error.

+4
source share
4 answers

For Ubuntu (linux), you will need to recompile Apache. A simple split will not work. In Ubuntu, I believe you can do some apt-get.

0
source

sudo apt-get install php5-mysql and then sudo apache2ctl graceful worked on my Ubuntu desktop

+6
source

I do not understand why you commented on the first line, you must NECESSARY

 extension=php_pdo_mysql.dll 

it worked for me!

0
source

Install

 sudo apt-get install php5-sqlite 

and restart apache2

 sudo service apache2 restart 

his work is for me.

0
source

All Articles