Yii Framework Forum: Cdbcache Error - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Cdbcache Error Rate Topic: -----

#1 User is offline   Janoo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 25
  • Joined: 17-June 12
  • Location:Hungary

Posted 06 March 2013 - 04:54 AM

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???
0

#2 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 2,085
  • Joined: 16-February 11
  • Location:Japan

Posted 06 March 2013 - 07:32 AM

According to the error message:

Quote

CDbConnection failed to open the DB connection: could not find driver


And according to the reference of CDbCache:

CDbCache.connectionID

Quote

the ID of the CDbConnection application component. If not set, a SQLite3 database will be automatically created and used. The SQLite database file is protected/runtime/cache-YiiVersion.db.


So, check and see your phpinfo(). Does it support pdo_sqlite?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users