CDbException

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

/website/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
+
 /website/mingsound/protected/controllers/BusinessController.php(72): CActiveRecord->find(array("condition" => "seotag=:seotag", "params" => array(":seotag" => "zcgl")))
67     public function loadModel($tag)
68     {
69         $model=Business::model()->find(array(
70             'condition'=>'seotag=:seotag',
71             'params'=>array(':seotag'=>$tag),
72         ));
73 
74         if($model===null)
75             throw new CHttpException(404,'请求页面不存在.');
76         return $model;
77     }
#8
+
 /website/mingsound/protected/controllers/BusinessController.php(53): BusinessController->loadModel("zcgl")
48         ));
49     }
50 
51     public function actionView($tag)
52     {
53         $model=$this->loadModel($tag);
54         $this->breadcrumbs=array(
55             '公司业务'=>$this->createUrl('business/index'),
56             CHtml::encode($model->name),
57         );
58         $this->currmenu='case';
#15
+
 /website/mingsound/protected/components/Controller.php(79): CFilter->filter(CFilterChain)
74 
75     public function filterAccessControl($filterChain)
76     {
77         $filter = new CWebAccessControlFilter();
78         $filter->setRules($this->accessRules());
79         $filter->filter($filterChain);
80     }
81 
82     private $_assetsUrl;
83 
84     public function getAssetsUrl()
2024-04-19 01:00:23 nginx/1.14.0 Yii Framework/1.1.20