CDbException

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known

/home/freespar/www/yii/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
+
 /home/freespar/www/protected/components/Controller.php(72): CActiveRecord->findAllByAttributes(array("option_name" => "pageTitle"))
67         }
68     }
69     
70     public function defaultMeta($meta)
71     {
72         $value = Options::model()->findAllByAttributes(array('option_name'=>$meta));
73         if(!empty($value[0]->option_value))
74         {
75             return $value[0]->option_value;
76         }
77     }
#8
+
 /home/freespar/www/protected/views/layouts/main.php(8): Controller->defaultMeta("pageTitle")
03 <!doctype html>
04 <html class="no-js" lang="en">
05 <head>
06     <meta charset="utf-8" />
07     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
08     <title><?php echo !empty($this->metaTitle) ? $this->DefaultMeta('pageTitle') .' - '.$this->metaTitle : $this->DefaultMeta('pageTitle') ?></title>
09 
10     <meta content="<?php echo !empty($this->metaDesc) ? $this->metaDesc : $this->DefaultMeta('defaultDesc') ?>" name="description">
11     <link href="<?php echo Yii::app()->getHomeUrl() ?>" rel="canonical">
12     <link href="<?php echo $this->DefaultMeta('googlePlusProfileUrl') ?>" rel="publisher">
13     <meta content="pl_PL" property="og:locale">
#16
+
 /home/freespar/www/protected/views/layouts/column1.php(8): CBaseController->endContent()
3 <div id="page-content" class="<?php echo $this->cssClass ?> row">
4 <div class="large-12 columns">
5     <?php echo $content; ?>
6 </div><!-- content -->
7 </div>
8 <?php $this->endContent(); ?>
2024-03-28 22:41:58 Apache Yii Framework/1.1.14