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(13): CActiveRecord->__construct()
08     }*/
09     public function actionindex(){
10         
11         $username = Yii::app()->session['username'];
12         $page = $_GET['page'] ;
13         $usermodel = new User();
14         $user = $usermodel->getUsernameToUser($username);    
15         $gg_model = new Gonggao();
16         $count = $gg_model->count();
17         $pagesize = 6;
18         $params = array( 
#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 15:51:10 nginx/1.18.0 Yii Framework/1.1.13