CDbException

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

/var/www/html/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

#7
+
 /var/www/html/protected/models/Category.php(104): CActiveRecord->findAll()
099         return parent::model($className);
100     }
101     public static function getCategoryTree($catId=null,$stream=null)
102     {
103 
104         $categories = Category::model()->findAll(array('condition'=>'attached_to_category_id=0', 'order'=>'`order` ASC'));
105 
106         $catMenu = array(
107          array('label'=>Yii::t("menu", 'HOME'), 'url'=>array('site/index'),'active'=>!($catId)&&!($stream),'linkOptions'=>array('class'=>'homeButtonNavigation')),
108          //array('label'=>Yii::t("menu", 'STREAM'), 'url'=> array('tweet/stream'),'active'=>($stream)),
109         );
#8
+
 /var/www/html/protected/components/Controller.php(32): Category::getCategoryTree()
27      */
28     public $breadcrumbs=array();
29 
30     public function beforeAction($action)
31     {
32         $this->menu = Category::getCategoryTree();
33         return true;
34         /*$cs = Yii::app()->clientScript;
35         $cs->registerCoreScript('jquery');*/
36 
37     }
#16
+
 /var/www/html/index.php(22): CApplication->run()
17 error_reporting(E_ALL);
18 ini_set("display_startup_errors","1");
19 ini_set("display_errors","1");
20 
21 require_once($yii);
22 Yii::createWebApplication($config)->run();
2024-03-28 14:58:32 Apache/2.4.41 (Ubuntu) Yii Framework/1.1.27