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/yii-1.1.13/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

#7
+
 /var/www/worstwebcomic/protected/models/Comic.php(29): CActiveRecord::model("Comic")
24      * Returns the static model of the specified AR class.
25      * @return Comic the static model class
26      */
27     public static function model($className=__CLASS__)
28     {
29         return parent::model($className);
30     }
31 
32     /**
33      * @return string the associated database table name
34      */
#8
+
 /var/www/worstwebcomic/protected/controllers/ComicController.php(12): Comic::model()
07     public $defaultAction = 'View';
08     public static $LASTCOMIC = 99999;
09     
10     private function GetComic($id, $availableOnly = true) {
11         if ($id === null || (!($this->comic = Comic::model()->GetComic($id, $availableOnly)))) {
12             $this->comic = Comic::model()->GetComic(null, $availableOnly);
13         }
14     }
15     
16     public function actionIndex()
17     {
#9
+
 /var/www/worstwebcomic/protected/controllers/ComicController.php(34): ComicController->GetComic(null, true)
29         $this->render('staticindex');
30     }
31     
32     public function actionView()
33     {
34         $this->GetComic((array_key_exists('id', $_GET) ? $_GET['id'] : NULL), Yii::app()->user->isGuest);
35         $this->pageTitle = 'WWC - ' . $this->comic->name;
36         if (isset($_GET['isAjaxRequest'])) {
37             $this->UpdateMenu();
38             $this->renderPartial('view');
39         }
2024-03-19 02:57:33 Apache/2.2.32 (Amazon) Yii Framework/1.1.13