Thanks for your valuable answer. I was totally fed-up with this. After getting your answer I tried to install memcache library and made modification in the ini file. Now it is working fine. My following code is working fine.
Code: Select all
<?php
error_reporting(-1);
ini_set('display_errors', true);
$memcache = new Memcache();
//$memcache->connect("10.1.11.33",11211) or die ("Could not connect");
$memcache->addServer("10.1.11.33",11211, 33);
echo "version = " . print_r($memcache->getVersion());
if ( ! extension_loaded('memcache')) {
throw new Doctrine_Cache_Exception('In order to use Memcache driver, the memcache extension must be loaded.');
}
?>
And from symfony I used resultcaching. It is also working. I verified by modifying the content in the database and the modified content is not loading in the result. But after the life span the changed content is loading.
Here is the code snippet which I used to load the cache driver in the symfony framwork.
Code: Select all
public function configureDoctrine(Doctrine_Manager $manager) {
$servers = array(
'host' => '10.1.11.33',
'port' => 11211,
'persistent' => true
);
$cacheDriver = new Doctrine_Cache_Memcache(array(
'servers' => $servers,
'compression' => false
)
);
//enable Doctrine cache
$manager = Doctrine_Manager::getInstance();
$manager->setAttribute(Doctrine::ATTR_RESULT_CACHE, $cacheDriver);
$manager->setAttribute(Doctrine::ATTR_RESULT_CACHE_LIFESPAN, 900);
}
But I have one more issue. When I tried to clear the cache it is giving me the an error
In order to use Memcache driver, the memcache extension must be loaded.
But in the sample code this error is not returning.
Do u have any solutions for this?
regards
Shihab