CDbException

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

/home2/sikder/public_html/yiiroot/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
+
 /home2/sikder/public_html/ambalanews24.com/protected/controllers/ArticleController.php(9): CActiveRecord->find("slug=:slug", array(":slug" => "%E0%A6%9C%E0%A6%BE%E0%A6%A8%E0%A7%8D%E0%A6%A8%E0%A6%BE%E0%A6%A4%..."))
04 
05     public $layout = '//layouts/main';
06     public $defaultAction = 'view';
07 
08     public function actionView($title) {
09         $model = Post::model()->find('slug=:slug', array(':slug' => urlencode($title)));
10         if ($model->status == 1 || (!Yii::app()->user->isGuest)) {
11             $this->increseRead($model->id, $model->times_of_read);
12 
13             $getCat = PostCategories::model()->findAll('post_id=:pid', array(':pid' => $model->id));
14             foreach ($getCat as $cat):
#17
+
 /home2/sikder/public_html/ambalanews24.com/index.php(20): CApplication->run()
15 defined('YII_DEBUG') or define('YII_DEBUG',true);
16 // specify how many levels of call stack should be shown in each log message
17 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
18 
19 require_once($yii);
20 Yii::createWebApplication($config)->run();
2024-03-29 11:33:07 Apache Yii Framework/1.1.15