CDbException

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

/var/www/html/www.contour.ru/yiisite/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/html/www.contour.ru/yiisite/protected/models/Structure.php(30): CActiveRecord::model("Structure")
25      *
26      * @return Structure the static model class
27      */
28     public static function model($className = __CLASS__)
29     {
30         return parent::model($className);
31     }
32 
33     public function translitUrl($str)
34     {
35         return YSHelper::rusTranslit($str);
#8
+
 /var/www/html/www.contour.ru/yiisite/protected/components/StructureUrl.php(61): Structure::model()
56             $cache = false;
57 
58 
59             if (!(!empty($cache['id']) && ($structure = Structure::model()->findByPk($cache['id'])))) {
60 
61                 $structure = Structure::model()->roots()->find();
62 
63                 $i = 0;
64         
65         if ($pathInfo == 'test'){
66             return "Site/Test";
#12
+
 /var/www/html/www.contour.ru/yiisite/protected/behaviors/WebApplicationEndBehavior.php(24): CApplication->run()
19 
20             // обрабатываем событие создания модуля
21             $this->onModuleCreate = array($this, 'changeModulePaths');
22             $this->onModuleCreate(new CEvent ($this->owner));
23 
24             $this->owner->run();
25         }
26 
27         // обработчик события onModuleCreate
28         public function onModuleCreate($event)
29         {
2024-03-15 08:38:59 Apache/2.4.10 (Debian) Yii Framework/1.1.12