CDbException

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2003] Can't connect to MySQL server on '127.0.0.1' (111)

/var/www/vh11468/data/www/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
+
 /var/www/vh11468/data/www/protected/controllers/PostController.php(110): CActiveRecord->findAll(CDbCriteria)
105         $condition = "`status_id` = '1' AND `start` <= '" . date('Y-m-d') . "' AND `end` >= '" . date('Y-m-d') . "' AND `category_id`='{$category}'";
106         $criteria = new CDbCriteria(array(
107             'condition' => $condition,
108             'order' => 'created DESC',
109             'limit' => 10));
110         $models = Post::model()->findAll($criteria);
111         $this->render('index', array(
112             'models' => $models,
113         ));
114     }
115 
#22
+
 /var/www/vh11468/data/www/stupinomuseum.ru/index.php(17): CApplication->run()
12 defined('YII_DEBUG') or define('YII_DEBUG',true);
13 // specify how many levels of call stack should be shown in each log message
14 // defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
15 
16 require_once($yii);
17 Yii::createWebApplication($config)->run();
2024-03-19 06:51:09 Apache/2.4.6 (CentOS) mpm-itk/2.4.7-04 OpenSSL/1.0.2k-fips PHP/5.6.40 Yii Framework/1.1.14