CDbException

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] No such file or directory

/usr/local/apache2/framework/db/CDbConnection.php(382)

370                 throw new CDbException('CDbConnection.connectionString cannot be empty.');
371             try
372             {
373                 Yii::trace('Opening DB connection','system.db.CDbConnection');
374                 $this->_pdo=$this->createPdoInstance();
375                 $this->initConnection($this->_pdo);
376                 $this->_active=true;
377             }
378             catch(PDOException $e)
379             {
380                 if(YII_DEBUG)
381                 {
382                     throw new CDbException('CDbConnection failed to open the DB connection: '.
383                         $e->getMessage(),(int)$e->getCode(),$e->errorInfo);
384                 }
385                 else
386                 {
387                     Yii::log($e->getMessage(),CLogger::LEVEL_ERROR,'exception.CDbException');
388                     throw new CDbException('CDbConnection failed to open the DB connection.',(int)$e->getCode(),$e->errorInfo);
389                 }
390             }
391         }
392     }
393 
394     /**

Stack Trace

#7
+
 /usr/local/apache2/htdocs/mobile/protected/controllers/NewsCategoryController.php(130): CActiveRecord->findByPk("16")
125      * If the data model is not found, an HTTP exception will be raised.
126      * @param integer the ID of the model to be loaded
127      */
128     public function loadModel($id)
129     {
130         $model=NewsCategory::model()->findByPk($id);
131         
132         return $model;
133     }
134 
135     /**
#8
+
 /usr/local/apache2/htdocs/mobile/protected/controllers/NewsCategoryController.php(47): NewsCategoryController->loadModel("16")
42      */
43     public function actionView($id)
44     {
45         $limit = 20;
46         unset(Yii::app()->session['more_news_offset_day']);
47         $model = $this->loadModel($id);
48 
49         Yii::app()->session['instant_category'] = $model->instant;
50         Yii::app()->session['selected_category'] = $id;
51         
52         if(false && Yii::app()->session['history_mode']) {
#23
+
 /usr/local/apache2/htdocs/mobile/index.php(13): CApplication->run()
08 defined('YII_DEBUG') or define('YII_DEBUG',true);
09 // specify how many levels of call stack should be shown in each log message
10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
11 
12 require_once($yii);
13 Yii::createWebApplication($config)->run();
14 
2024-03-29 13:45:20 Apache/2.2.22 (Unix) PHP/5.4.3 Yii Framework/1.1.15