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(174): CActiveRecord->__construct()
169     }
170     public function actionResetpwd(){
171 
172         $channel = trim($_REQUEST['channel']);
173         $appid = trim($_REQUEST['appid']);
174         $appmodel = new Cpapp();
175         $appinfo = $appmodel->appinfo($appid);
176         $template = Yii::app()->params['templates'] . '/h5sdk/resetpwd.php';
177         echo $this->processOutput( $this->renderFile( $template, array('background'=>$appinfo['background'])));
178 
179     }        
#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 19:26:25 nginx/1.18.0 Yii Framework/1.1.15