CDbException

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

/var/www/vhosts/aquieuropa.com/yii-1.1.16.bca042/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

#4
+
 /var/www/vhosts/aquieuropa.com/httpdocs/protected/components/UserIdentity.php(30): CApplication->getDb()
25      *
26      * @return boolean whether authentication succeeds.
27      */
28     public function authenticate()
29     {
30         $db = Yii::app()->getDb();
31         /* @var $login ClienteLogin */
32         if ($this->ip) {
33             $login = ClienteLogin::model()->active()->findByAttributes(array('ip' => $this->ip), array('limit' => 1));
34             if ($login) {
35                 $this->_id = $login->fk_id_cliente;
#5
+
 /var/www/vhosts/aquieuropa.com/httpdocs/protected/components/Controller.php(44): UserIdentity->authenticate()
39         $this->allowFullAccessByIp = $this->hasFullAccessByIp($ip);
40 
41         if ($user->isGuest) {
42             $identity = new UserIdentity(null, null);
43             $identity->ip = $ip;
44             $identity->authenticate();
45             if ($identity->errorCode === UserIdentity::ERROR_NONE) {
46                 $this->isLoginByIp = true;
47                 $duration = 3600;
48                 Yii::app()->user->login($identity, $duration);
49             }
#12
+
 /var/www/vhosts/aquieuropa.com/httpdocs/index.php(13): CApplication->run()
08 defined('YII_DEBUG') or define('YII_DEBUG', true);
09 // specify how many levels of call stack should be shown in each log message
10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
11 
12 require_once($yii);
13 Yii::createWebApplication($config)->run();
2024-03-29 02:55:13 Apache Yii Framework/1.1.16