CDbException

Description

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

Source File

/home/data/web/vhosts/saxophone.org/protected/components/WebApplication.php(13)

00001: <?php class WebApplication extends CWebApplication {
00002:     
00003:     public $siteLoc;
00004:     public $domain;
00005:     public $yahooAppId;
00006:     
00007: 
00008:     public function getDbOld() {
00009:         return $this->getComponent('dbOld');
00010:     }
00011:     
00012:     public function beforeControllerAction($controller,$action) {
00013: if( is_object(Yii::app()->user) && isset($_SERVER['HTTP_REFERER']) && !preg_match('/login$/',$_SERVER['HTTP_REFERER']) ) {
00014: Yii::app()->user->setReturnUrl($_SERVER['HTTP_REFERER']); 00015: } 00016: return parent::beforeControllerAction($controller,$action); 00017: } 00018: 00019: public function getSessionCount() 00020: { 00021: $now = date('Y-m-d H:i:s',strtotime('-1 hour')); 00022: 00023: $command = $this->db->createCommand("SELECT count(id) AS num_records FROM YiiSession WHERE `lastActive` > '{$now}'"); 00024: $result = $command->queryAll(); 00025: if( !empty($result[0]['num_records']) ) {

Stack Trace

#0 /home/data/web/vhosts/saxophone.org/framework/db/CDbConnection.php(242): CDbConnection->open()
#1 /home/data/web/vhosts/saxophone.org/framework/db/CDbConnection.php(221): CDbConnection->setActive(true)
#2 /home/data/web/vhosts/saxophone.org/framework/base/CModule.php(363): CDbConnection->init()
#3 /home/data/web/vhosts/saxophone.org/framework/web/CDbHttpSession.php(109): CModule->getComponent('db')
#4 /home/data/web/vhosts/saxophone.org/framework/web/CDbHttpSession.php(131): CDbHttpSession->getDbConnection()
#5 [internal function]: CDbHttpSession->openSession('/var/lib/php/se...', 'PHPSESSID')
#6 /home/data/web/vhosts/saxophone.org/framework/web/CHttpSession.php(100): session_start()
#7 /home/data/web/vhosts/saxophone.org/framework/web/CHttpSession.php(75): CHttpSession->open()
#8 /home/data/web/vhosts/saxophone.org/framework/base/CModule.php(363): CHttpSession->init()
#9 /home/data/web/vhosts/saxophone.org/framework/web/CWebApplication.php(181): CModule->getComponent('session')
#10 /home/data/web/vhosts/saxophone.org/framework/web/auth/CWebUser.php(163): CWebApplication->getSession()
#11 /home/data/web/vhosts/saxophone.org/framework/base/CModule.php(363): CWebUser->init()
#12 /home/data/web/vhosts/saxophone.org/framework/base/CModule.php(86): CModule->getComponent('user')
#13 /home/data/web/vhosts/saxophone.org/protected/components/WebApplication.php(13): CModule->__get('user')
#14 /home/data/web/vhosts/saxophone.org/framework/web/CController.php(255): WebApplication->beforeControllerAction(Object(ForumController), Object(CInlineAction))
#15 /home/data/web/vhosts/saxophone.org/framework/web/CWebApplication.php(324): CController->run('replyPost')
#16 /home/data/web/vhosts/saxophone.org/framework/web/CWebApplication.php(121): CWebApplication->runController('forum/replyPost...')
#17 /home/data/web/vhosts/saxophone.org/framework/base/CApplication.php(135): CWebApplication->processRequest()
#18 /home/data/web/vhosts/saxophone.org/index.php(36): CApplication->run()
#19 {main}
2024-03-28 16:37:22 Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.6.40 Yii Framework/1.1.3

Notice: Trying to get property of non-object in /home/data/web/vhosts/saxophone.org/protected/components/Controller.php on line 311

Fatal error: Uncaught exception 'CDbException' with message 'Active Record requires a "db" CDbConnection application component.' in /home/data/web/vhosts/saxophone.org/protected/components/ActiveRecord.php:168 Stack trace: #0 /home/data/web/vhosts/saxophone.org/framework/db/ar/CActiveRecord.php(2048): ActiveRecord->getDbConnection() #1 /home/data/web/vhosts/saxophone.org/framework/db/ar/CActiveRecord.php(353): CActiveRecordMetaData->__construct(Object(User)) #2 /home/data/web/vhosts/saxophone.org/protected/models/User.php(531): CActiveRecord::model('User') #3 /home/data/web/vhosts/saxophone.org/protected/components/Controller.php(312): User::model() #4 [internal function]: Controller->__destruct() #5 {main} thrown in /home/data/web/vhosts/saxophone.org/protected/components/ActiveRecord.php on line 168

Fatal error: Uncaught exception 'CException' with message 'CDbHttpSession.connectionID "db" is invalid. Please make sure it refers to the ID of a CDbConnection application component.' in /home/data/web/vhosts/saxophone.org/framework/web/CDbHttpSession.php:112 Stack trace: #0 /home/data/web/vhosts/saxophone.org/framework/web/CDbHttpSession.php(176): CDbHttpSession->getDbConnection() #1 [internal function]: CDbHttpSession->writeSession('j2jnp2qkr550uuc...', '') #2 {main} thrown in /home/data/web/vhosts/saxophone.org/framework/web/CDbHttpSession.php on line 112