CDbException

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

/home/wwwroot/default/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

#8
+
 /home/wwwroot/default/h5sdk/protected/controllers/H5sdkController.php(17): CActiveRecord->__construct()
12         }*/
13         $channel = trim($_REQUEST['channel']);
14         $appid = trim($_REQUEST['appid']);
15         $accountName =  trim($_REQUEST['accountName']);
16 
17         $appmodel = new Cpapp();
18         $appinfo = $appmodel->appinfo($appid);
19         if( $accountName){
20             $usermodel = new User();
21             if( !$userinfo = $usermodel->getUsernameToUser( $accountName) ){
22                 $columns = array('username'=>$accountName,'password'=>md5(md5('123456')),'phone'=>'','openid'=>$accountName,'channel'=>$channel,'appid'=>$appid,'reg_channel'=>$channel,'reg_appid'=>$appid,'islock'=>0, 'regtime'=>time(), 'regip'=>Yii::app()->request->userHostAddress, 'lastlogin'=>time(), 'lastloginip'=>Yii::app()->request->userHostAddress );
#16
+
 /home/wwwroot/default/h5sdk/index.php(12): CApplication->run()
07 
08 // remove the following lines when in production mode
09 defined('YII_DEBUG') or define('YII_DEBUG',true);
10 
11 require_once($yii);
12 Yii::createWebApplication($config)->run();
2024-03-29 23:46:45 nginx/1.18.0 Yii Framework/1.1.15