Hello,
I have the Yii Framework in which I have made 2 more files like commons.php and env.php. commons.php is taken for modules and env.php is taken for database connection. Here I have used Cmap::mergeArray() to merge all the array.
I have used it like this
<?php
// change the following paths if necessary
$yii=dirname(__FILE__).'/framework/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';
// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
require_once($yii);
$config=CMap::mergeArray(
require(dirname(__FILE__).'/protected/config/main.php'),
require(dirname(__FILE__).'/protected/config/commons.php'),
require(dirname(__FILE__).'/protected/config/env.php'),
);
Yii::createWebApplication($config)->run();
in env.php I have made database connection.So this is the code part
<?php
return array(
// uncomment the following to use a MySQL database
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=ia_databasename',
'emulatePrepare' => true,
'username' => 'XXX',
'password' => 'XXX',
'charset' => 'utf8',
'TablePrefix' => 'ia_',
),
);
But after all this whenever I am going to login to my application through user/login, it is showing error like
CDbConnection failed to open the DB connection: could not find driver
Why it is behaving like this? Please help me to solve this…