Hi,
I have a weird problem with existing Yii application.
Recently I installed Linux Mint and set up apache, php, and mysql with no problems.
Phpmyadmin and ‘normal’ applications work without problems but my Yii application throws “CDbConnection failed to open the DB connection: could not find driver”.
So i thought maybe PDO driver is missing but it’s not. Phpinfo says PDO driver is loaded and I connected to database with
new PDO('mysql:host=localhost;dbname=$mydb', $user, $pass);
with no problems.
Also,
print_r(PDO::getAvailableDrivers());
shows
Array ( [0] => mysql )
In application connection is set with:
'components'=>array(
'db'=>array(
'connectionString' => 'mysql:host=127.0.0.1;dbname=mydb',
'emulatePrepare' => true,
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'enableParamLogging'=> true,
'schemaCachingDuration' => 3600,
'class'=>'CDbConnection',
),
),
and it worked so far in windows with no problems.
I out of ideas why this wouldn’t work. Any help is appreciated.