im trying to include memcache within the yii framework.

within main.php i’ve added this to the components array:











when i refresh i get the following error message:

include(Memcached.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory [

im 100% sure memcache works properly as it works fine with a simple php file


$memcache = new Memcache;

$memcache->connect('localhost', 11211) or die ("Could not connect");

$version = $memcache->getVersion();

echo "Server's version: ".$version."<br/>\n";

$tmp_object = new stdClass;

$tmp_object->str_attr = 'test';

$tmp_object->int_attr = 123;

//$memcache->set('key', $tmp_object, false, 10) or die ("Failed to save data at the server");

echo "Store data in the cache (data will expire in 10 seconds)<br/>\n";

$get_result = $memcache->get('key');

echo "Data from the cache:<br/>\n";





Memcache and Memcached are not the same thing.

Try ‘useMemcached’=>false.

Dear All ;D

guys, Can I ask you something. can anyone give me an example of how to use the memcached in YII.

for example when we are using $dataProvider=new CActiveDataProvider()?

and how we should know that the memcached is effective, is there any script to tested it?

I have read several post about it, but to be honest i am still a litle bit in the dark.

Thank You in advance for your kind response.


T :D