CDbException

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

/var/www/virtual-hosts/iip.ru/production/frameworks/yii1114/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

#7
+
 /var/www/virtual-hosts/iip.ru/production/htdocs/protected/components/framework/BaseController.php(135): CActiveRecord->findByAttributes(array("latin_name" => "ulyanovskaya-oblast"))
130         }
131         $regionId = null;
132         $subDomain = $this->getCurrentDomain();
133 
134         if ($subDomain) { #попробуем найти регион в домене
135             $regionDomain = Region::model()->findByAttributes(array('latin_name' => $subDomain));
136             if ($regionDomain) {
137                 $regionId = $regionDomain->id;
138             }
139         }
140         if (is_null($regionId)) {
#8
+
 /var/www/virtual-hosts/iip.ru/production/htdocs/protected/components/framework/BaseController.php(51): BaseController->getCurrentRegion()
46 
47     public function init()
48     {
49         header('Content-Type: text/html; charset=utf-8');
50         parent::init();
51         $this->currentRegion = $this->getCurrentRegion();
52         $this->region = Region::model()->findByPk($this->currentRegion);
53         if (!Yii::app()->user->isGuest) {
54             $this->user = User::model()->findByPk(Yii::app()->user->id);
55             $this->currentLanguage = $this->user->language_id;
56             $this->_balance = Balance::get(Yii::app()->user->id);
#12
+
 /var/www/virtual-hosts/iip.ru/production/htdocs/index.php(15): CApplication->run()
10 
11 // specify how many levels of call stack should be shown in each log message
12 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
13 
14 require_once($yii);
15 Yii::createWebApplication($config)->run();
2024-04-18 20:45:48 Apache/2.2.16 (Debian) Yii Framework/1.1.15