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' (2)

/var/www/framework/db/CDbConnection.php(381)

369                 throw new CDbException('CDbConnection.connectionString cannot be empty.');
370             try
371             {
372                 Yii::trace('Opening DB connection','system.db.CDbConnection');
373                 $this->_pdo=$this->createPdoInstance();
374                 $this->initConnection($this->_pdo);
375                 $this->_active=true;
376             }
377             catch(PDOException $e)
378             {
379                 if(YII_DEBUG)
380                 {
381                     throw new CDbException('CDbConnection failed to open the DB connection: '.
382                         $e->getMessage(),(int)$e->getCode(),$e->errorInfo);
383                 }
384                 else
385                 {
386                     Yii::log($e->getMessage(),CLogger::LEVEL_ERROR,'exception.CDbException');
387                     throw new CDbException('CDbConnection failed to open the DB connection.',(int)$e->getCode(),$e->errorInfo);
388                 }
389             }
390         }
391     }
392 
393     /**

Stack Trace

#9
+
 /var/www/html/protected/controllers/DateController.php(11): CActiveRecord->__construct()
06     public $defaultAction = 'browse';
07     
08     public function actionBrowse()
09     {
10         
11         $model = new Matrix;
12         if (isset($_POST['Matrix'])) $model->attributes = $_POST['Matrix'];
13 
14         $date = (isset($_GET['date'])) ? $_GET['date'] : Yii::app()->params['initialDate'];
15 
16         $data = $model->browseByDate($date);
#17
+
 /var/www/html/index.php(15): CApplication->run()
10 
11 // run Yii app
12 //$env->showDebug(); // show produced environment configuration
13 require_once($env->yiiPath);
14 $env->runYiiStatics(); // like Yii::setPathOfAlias()
15 Yii::createWebApplication($env->configWeb)->run();
2024-03-29 02:45:05 Apache/2.2.15 (CentOS) Yii Framework/1.1.13