CDbException

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] No route to host

/var/www/Public/yii/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

#3
+
 /var/www/Public/scholarship/protected/components/MultiActiveRecord.php(22): CModule->getComponent("db_phaddress")
17     public function getDbConnection()
18     {
19         $dbName=$this->connectionId();
20         
21         if(!isset(self::$db[$dbName])){
22             if(Yii::app()->hasComponent($dbName) && (self::$db[$dbName]=Yii::app()->getComponent($dbName)) instanceof CDbConnection){
23                 self::$db[$dbName]->setActive(true);
24             }else
25                 throw new CDbException(Yii::t('yii','Active Record requires a "'.$dbName.'" CDbConnection application component.'));
26         }
27         
#6
+
 /var/www/Public/scholarship/protected/controllers/SiteController.php(70): CActiveRecord->findByPk("8")
65      */
66     public function actionIndex()
67     {
68         
69         $regionId=Yii::app()->params['Region']['id'];
70         $region=PhAddressRegion::model()->findByPk($regionId);
71         //echo "<pre>"; 
72         //print_r($region);
73         //echo "</pre>"; 
74         $criteria=new CDbCriteria;
75         $criteria->with=array('address','address.municipality', 'address.municipality.province');
#19
+
 /var/www/Public/scholarship/index.php(15): CApplication->run()
10 defined('YII_DEBUG') or define('YII_DEBUG',true);
11 // specify how many levels of call stack should be shown in each log message
12 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
13 
14 require_once($yii);
15 Yii::createWebApplication($config)->run();
16 
17 
2024-03-29 05:19:15 Apache/2.4.29 (Ubuntu) Yii Framework/1.1.22-dev