CDbException

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)

/var/www/html/pi2015/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/pi2015/protected/components/Controller.php(99): CActiveRecord->find(array("condition" => "count_page_ip=:ip AND count_date=:date AND t.group=:group AND co...", "params" => array(":ip" => "44.206.227.65", ":date" => "2024-03-28", ":url" => "http://www.knc.ac.th/news/322", ":group" => 1)))
094                 'condition'=>'count_page_ip=:ip AND count_date=:date AND t.group=:group AND count_page_url=:url', 'params' => array(
095                     ':ip' => $ip, 
096                     ':date' => $date,
097                     ':url' => $route,
098                     ':group' => $group
099             )));
100 
101             if(isset($LogIP) && count($LogIP) != 0)
102             {
103                 $counterPage = CountPage::model()->findByPk($LogIP->count_page_id);
104                 $counterPage->count_number += 1;
#14
+
 /var/www/html/pi2015/index.php(14): CApplication->run()
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 
13 require_once($yii);
14 Yii::createWebApplication($config)->run();
2024-03-28 18:18:41 Apache Yii Framework/1.1.16