Hy everybody!
I don’t find any solution for CDbCache. On my localhost it works fine.
in my config:
'cache'=>array(
'class'=>'CDbCache',
),
It’s oke. It create a file in the runtime folder, and run fine, and the website is faster.
But on some server it give an error:
CDbException
CDbConnection failed to open the DB connection: could not find driver
/var/www/framework/db/CDbConnection.php(382)
370 throw new CDbException(Yii::t(‘yii’,‘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(Yii::t(‘yii’,‘CDbConnection failed to open the DB connection: {error}’,
383 array(’{error}’=>$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(Yii::t(‘yii’,‘CDbConnection failed to open the DB connection.’),(int)$e->getCode(),$e->errorInfo);
389 }
390 }
391 }
392 }
393
394 /**
Stack Trace
#0
/var/www/framework/db/CDbConnection.php(331): CDbConnection->open()
#1
/var/www/framework/caching/CDbCache.php(79): CDbConnection->setActive(true)
#2
/var/www/framework/base/CModule.php(388): CDbCache->init()
#3
/var/www/framework/db/schema/CDbSchema.php(91): CModule->getComponent("cache")
#4
/var/www/framework/db/ar/CActiveRecord.php(2263): CDbSchema->getTable("users")
#5
/var/www/framework/db/ar/CActiveRecord.php(379): CActiveRecordMetaData->__construct(User)
#6
–
/var/www/leg-technic/protected/modules/user/models/User.php(13): CActiveRecord::model("User")
08
09 public static $newsLetterStatus = array(0=>‘nem’, 1=>‘igen’);
10
11 public static function model($className=CLASS)
12 {
13 return parent::model($className);
14 }
15
16 public function tableName()
17 {
18 return Yii::app()->getModule(‘user’)->tableUsers;
#7
–
/.../
2013-03-06 10:37:35 Apache Yii Framework/1.1.10
And I just notice, $this->beginCache – does not work too.
Any idea???