CDbException

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] Connection refused

/var/www/html/framework/db/CDbConnection.php(399)

387                 throw new CDbException('CDbConnection.connectionString cannot be empty.');
388             try
389             {
390                 Yii::trace('Opening DB connection','system.db.CDbConnection');
391                 $this->_pdo=$this->createPdoInstance();
392                 $this->initConnection($this->_pdo);
393                 $this->_active=true;
394             }
395             catch(PDOException $e)
396             {
397                 if(YII_DEBUG)
398                 {
399                     throw new CDbException('CDbConnection failed to open the DB connection: '.
400                         $e->getMessage(),(int)$e->getCode(),$e->errorInfo);
401                 }
402                 else
403                 {
404                     Yii::log($e->getMessage(),CLogger::LEVEL_ERROR,'exception.CDbException');
405                     throw new CDbException('CDbConnection failed to open the DB connection.',(int)$e->getCode(),$e->errorInfo);
406                 }
407             }
408         }
409     }
410 
411     /**

Stack Trace

#7
+
 /var/www/html/protected/components/Controller.php(33): CActiveRecord->find()
28      */
29     public $breadcrumbs=array();
30 
31     public function init() {
32         $app = Yii::app();
33         $siteSetting = Sitesettings::model()->find();
34         $sitename = $siteSetting->sitename;
35         $metaData = json_decode($siteSetting->metaData, true);
36         if(!empty($metaData)){
37             $metaTitle = $metaData['metaTitle'];
38             $metaDescription = $metaData['metaDescription'];
#11
+
 /var/www/html/index.php(0): CApplication->run()
2024-03-19 02:37:39 Apache/2.4.18 (Ubuntu) Yii Framework/1.1.16-dev