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/i.anqu.com/protected/controllers/ResetpwdController.php(506): CActiveRecord->__construct()
501     }
502 
503     //初始化
504     public function init() {
505 
506         $model = new UserConfig();
507         $this->config = $config = $model->getConfig();
508 
509         define('UC_CONNECT', NULL);
510         define('UC_KEY', $config['uc_key']);
511         define('UC_API', $config['uc_api']);
#13
+
 /home/wwwroot/anqu/anqusdk/i.anqu.com/index.php(29): CApplication->run()
24 25 define('ERR_CODE_007_REPAY_ERR','007');
26 27 define('ERR_CODE_010_BANK_PAY_ERR','010');    
28 require_once($yii);
29 Yii::createWebApplication($config)->run();
2024-03-28 21:18:26 nginx/1.18.0 Yii Framework/1.1.13