CDbException

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known

/home/wwwroot/anqu/anqusdk/framework/db/CDbConnection.php(381)

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

Stack Trace

#9
+
 /home/wwwroot/anqu/anqusdk/u.anqu.com/protected/controllers/GonggaoController.php(60): CActiveRecord->__construct()
55         echo $this->processOutput( $this->renderFile( $template, array('gonggao'=>$posts,'pages'=>$pages,'power'=>$user['power'],'isgrant'=>$user['isgrant'])));      
56         }
57      public function actiongonggao(){    
58          
59          $username = Yii::app()->session['username'];
60         $usermodel = new User();
61         $user = $usermodel->getUsernameToUser($username);    
62          $id = $_GET['id'];
63         $gonggaomodel = new Gonggao();
64          if($gonggao = $gonggaomodel->gonggaoinfo($id)){
65             $template = Yii::app()->params['templates'] . '/gonggao/gonggao.php';
#17
+
 /home/wwwroot/anqu/anqusdk/u.anqu.com/index.php(11): CApplication->run()
06 
07 $config=dirname(__FILE__).'/protected/config/main.php';
08 defined('YII_DEBUG') or define('YII_DEBUG',true);
09 date_default_timezone_set('PRC'); 
10 require_once($yii);
11 Yii::createWebApplication($config)->run();
2024-03-29 13:27:36 nginx/1.18.0 Yii Framework/1.1.13