CDbException

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] No such file or directory

/var/www/html/eurekit/framework-1.1.14/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

#8
+
 /var/www/html/eurekit/protected/views/site/categorias.php(42): CActiveRecord->__call()
37         //echo '<h2>'.Yii::t('conteudo','Jogos').'</h2>'; 
38         //echo '<p>'.Yii::t('conteudo','Esta área encontra-se em manutenção. Por favor tente aceder mais tarde.').'</p>';
39     }
40 } else {
41 
42     $modulos = Modulo::model()->sorted()->findAll(array('condition' => 'Categoria_idCategoria=' . $_GET['id']));
43 
44     if ($modulos != null) {
45         $cat=Categoria::model()->findByPk($_GET['id']);
46         if (Yii::app()->language == 'en') {
47             $nome = $cat->nome_en;                
#13
+
 /var/www/html/eurekit/protected/controllers/SiteController.php(110): CController->render()
105     }
106         
107         public function actionCategorias(){
108             $this->layout='//layouts/column2';
109             
110             $this->render('categorias');
111         }
112         
113         public function actionJogos(){
114             $this->layout='//layouts/column2';
115             
#21
+
 /var/www/html/eurekit/index.php(16): CApplication->run()
11 defined('YII_DEBUG') or define('YII_DEBUG',true);//com true tá em modo de depuraçao para vermos erros a desenvolver e melhor
12 // specify how many levels of call stack should be shown in each log message
13 // defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
14 
15 require_once($yii);
16 Yii::createWebApplication($config)->run();//Para aplicar a configuração, passamos o nome do arquivo de configuração como um parâmetro ao construtor da aplicação
17                                             //pasta config
2024-03-29 09:20:37 Apache/2.4.52 (Ubuntu) Yii Framework/1.1.14