CDbException

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

/var/www/vhosts/aseemamag.com/epaper.hosadigantha.com/protected/components/Settings.php(35)

23         return $instance;
24     }
25     
26     protected function __construct() { }
27 
28     private $_settings;
29     
30     /**
31      * Initiates the settings
32      * @return array
33      */
34     public function init(){
35         $cmd = Yii::app()->db->createCommand();
36         $result = $cmd->select("*")->from("settings")->queryAll();        
37         if (count($result) > 0) {
38             foreach ($result as $r) {
39                 $this->_settings[$r["opt_class"]][$r["opt_key"]] = $r["opt_value"];
40             }
41         }
42         return $this->_settings;
43     }
44     
45     /**
46      * Returns the value of setting key. Returns false if not found
47      * @param string $key

Stack Trace

#4
+
 /var/www/vhosts/aseemamag.com/epaper.hosadigantha.com/protected/components/Settings.php(35): CModule->__get()
30     /**
31      * Initiates the settings
32      * @return array
33      */
34     public function init(){
35         $cmd = Yii::app()->db->createCommand();
36         $result = $cmd->select("*")->from("settings")->queryAll();        
37         if (count($result) > 0) {
38             foreach ($result as $r) {
39                 $this->_settings[$r["opt_class"]][$r["opt_key"]] = $r["opt_value"];
40             }
#5
+
 /var/www/vhosts/aseemamag.com/epaper.hosadigantha.com/protected/components/Settings.php(21): Settings->init()
16      */
17     public static function i(){
18         static $instance = null;
19         if (null === $instance) {            
20             $instance = new static();            
21             $instance->init();
22         }
23         return $instance;
24     }
25     
26     protected function __construct() { }
#6
+
 /var/www/vhosts/aseemamag.com/epaper.hosadigantha.com/protected/components/abstracts/AbstractAdminSettingsForm.php(198): Settings::i()
193      */
194     public static function i(){
195         static $instance = null;
196         if (null === $instance) {            
197             $instance = new static();
198             $data = Settings::i()->getByClass(get_called_class());
199             if (!is_null($data)) {
200                 $instance->attributes = $data;
201             }
202         }        
203         return $instance;
2024-03-28 11:09:27 nginx/1.24.0 Yii Framework/1.1.19