CDbException

CDbConnection nie zdołał otworzyć połączenia DB: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: A non-recoverable error occurred during a database lookup.

D:\Mail\Luteranie\mikolow\framework\db\CDbConnection.php(364)

352                 throw new CDbException(Yii::t('yii','CDbConnection.connectionString cannot be empty.'));
353             try
354             {
355                 Yii::trace('Opening DB connection','system.db.CDbConnection');
356                 $this->_pdo=$this->createPdoInstance();
357                 $this->initConnection($this->_pdo);
358                 $this->_active=true;
359             }
360             catch(PDOException $e)
361             {
362                 if(YII_DEBUG)
363                 {
364                     throw new CDbException(Yii::t('yii','CDbConnection failed to open the DB connection: {error}',
365                         array('{error}'=>$e->getMessage())),(int)$e->getCode(),$e->errorInfo);
366                 }
367                 else
368                 {
369                     Yii::log($e->getMessage(),CLogger::LEVEL_ERROR,'exception.CDbException');
370                     throw new CDbException(Yii::t('yii','CDbConnection failed to open the DB connection.'),(int)$e->getCode(),$e->errorInfo);
371                 }
372             }
373         }
374     }
375 
376     /**

Stack Trace

#7
+
 D:\Mail\Luteranie\mikolow\protected\models\Articles.php(24): CActiveRecord::model()
19      * Returns the static model of the specified AR class.
20      * @return Articles the static model class
21      */
22     public static function model($className=__CLASS__)
23     {
24         return parent::model($className);
25     }
26 
27     /**
28      * @return string the associated database table name
29      */
#8
+
 D:\Mail\Luteranie\mikolow\protected\controllers\ArticlesController.php(260): Articles::model()
255      * If the data model is not found, an HTTP exception will be raised.
256      * @param integer the ID of the model to be loaded
257      */
258     public function loadModel($id)
259     {
260         $model=Articles::model()->findByPk($id);
261         if($model===null)
262             throw new CHttpException(404,'The requested page does not exist.');
263         return $model;
264     }
265 
#9
+
 D:\Mail\Luteranie\mikolow\protected\controllers\ArticlesController.php(54): ArticlesController->loadModel()
49      * @param integer $id the ID of the model to be displayed
50      */
51     public function actionView($id)
52     {
53         $this->layout = '//layouts/column1';
54         $model = $this->loadModel($id);
55         $gallery = Gallery::model()->findAll('article_id=:AID order by main desc, id desc',array(':AID'=>$model->id));
56         $this->render('view',array(
57             'model'=>$model,
58             'gallery'=>$gallery
59         ));
2026-01-15 06:55:28 Microsoft-IIS/10.0 Yii Framework/1.1.8