CDbException

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [1040] Too many connections

/var/www/html/com.fydyyw.www/framework/db/CDbConnection.php(399)

387                 throw new CDbException('CDbConnection.connectionString cannot be empty.');
388             try
389             {
390                 Yii::trace('Opening DB connection','system.db.CDbConnection');
391                 $this->_pdo=$this->createPdoInstance();
392                 $this->initConnection($this->_pdo);
393                 $this->_active=true;
394             }
395             catch(PDOException $e)
396             {
397                 if(YII_DEBUG)
398                 {
399                     throw new CDbException('CDbConnection failed to open the DB connection: '.
400                         $e->getMessage(),(int)$e->getCode(),$e->errorInfo);
401                 }
402                 else
403                 {
404                     Yii::log($e->getMessage(),CLogger::LEVEL_ERROR,'exception.CDbException');
405                     throw new CDbException('CDbConnection failed to open the DB connection.',(int)$e->getCode(),$e->errorInfo);
406                 }
407             }
408         }
409     }
410 
411     /**

Stack Trace

#8
+
 /var/www/html/com.fydyyw.www/web/protected/modules/template/controllers/MenuController.php(29): CActiveRecord->__construct()
24     //联系方式
25     public function  actionContact(){
26 
27         $id = $_GET['fid'];
28 
29         $data1 = (new BaseModel ())->doSelect ($id);
30 
31         $data2 = (new BaseModel ())->doSelect1 ($id);
32 
33         $data = array (
34 
#16
+
 /var/www/html/com.fydyyw.www/web/config.php(12): CApplication->run()
07     defined('YII_DEBUG') or define('YII_DEBUG',true);
08     // specify how many levels of call stack should be shown in each log message
09     defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
10 
11     require_once($yii);
12     Yii::createWebApplication($config)->run();
13     // 冯涛
14     // yii::app()->session->setTimeout(604800);
15 
16 
#17
+
 /var/www/html/com.fydyyw.www/web/index.php(4): include("/var/www/html/com.fydyyw.www/web/config.php")
1 <?php
2     define('ROOT_PATH', __DIR__);
3     header('Content-Type:text/html;charset=utf-8');
4     include 'config.php';
5     exit();
6 ?>
2024-03-29 00:19:38 nginx/1.16.0 Yii Framework/1.1.16