problem with MemCache

[font="Times New Roman"][size="2"]Hi[/size][/font]

[font="Times New Roman"][size="2"]I install memcached and php5-memcached on ubuntu and then go to yii and write below config in main-local.php:[/size][/font]

[font="Times New Roman"] [/font]

[font=“Times New Roman”][color="#ff0000"][size=“2”]‘cache’=>[[/size][/color][/font]

[font=“Times New Roman”][color="#ff0000"][size=“2”] ‘class’=>‘yii\caching\MemCache’,[/size][/color][/font]

[font=“Times New Roman”][color="#ff0000"][size=“2”] ‘servers’=>[[/size][/color][/font]

[font="Times New Roman"][color="#ff0000"][size="2"] [[/size][/color][/font]

[font=“Times New Roman”][color="#ff0000"][size=“2”] ‘host’=>‘127.0.0.1’,[/size][/color][/font]

[font=“Times New Roman”][color="#ff0000"][size=“2”] ‘port’=>‘11211’,[/size][/color][/font]

[font=“Times New Roman”][color="#ff0000"][size=“2”] ‘weight’=>‘90’,[/size][/color][/font]

[font="Times New Roman"][color="#ff0000"][size="2"] ],[/size][/color][/font]

[font="Times New Roman"][color="#ff0000"][size="2"] ][/size][/color][/font]

[font="Times New Roman"][color="#ff0000"][size="2"] ],[/size][/color][/font]

[font="Times New Roman"][size="2"]then I go to controller and write below action:[/size][/font]

[font="Times New Roman"] [/font]

[font=“Times New Roman”][size=“3”][color="#ff0000"]public function actionTst()[/color][/size][size=“3”][color="#ff0000"] {[/color][/size][size=“3”][color="#ff0000"] $cached_data=Yii::$app->cache->get(‘mtext’);//search in cache Is there mtext in cache?[/color][/size][size=“3”][color="#ff0000"] if($cached_data!=false)[/color][/size][size=“3”][color="#ff0000"] {[/color][/size][size=“3”][color="#ff0000"] echo $cached_data;[/color][/size][size=“3”][color="#ff0000"] echo “<hr/>”;[/color][/size][size=“3”][color="#ff0000"] echo “data from cache”;[/color][/size][size=“3”][color="#ff0000"] }[/color][/size][size=“3”][color="#ff0000"] else[/color][/size][size=“3”][color="#ff0000"] {[/color][/size][size=“3”][color="#ff0000"] $data=‘mohammad soltani is very good and he lives in esfahan’;[/color][/size][size=“3”][color="#ff0000"] Yii::$app->cache->set(‘mtext’,$data);[/color][/size][size=“3”][color="#ff0000"] echo $data;[/color][/size][size=“3”][color="#ff0000"] echo “<hr/>”;[/color][/size][size=“3”][color="#ff0000"] echo “data not found on cache”;[/color][/size][size=“3”][color="#ff0000"] }[/color][/size][size=“3”][color="#ff0000"] }[/color][/size][/font]

[font="Times New Roman"] [/font]

[font="Times New Roman"][size="3"]then,I run this action in browser and the below error is show to me:[/size][size="3"]

[color="#FF0000"][size="2"]Invalid Configuratin - yii\base\InvalidConfigException[/size][/color]

[color="#FF0000"][size="2"]MemCache requires PHP memcache extension to be loaded.[/size][/color]

[/size][size="3"][color="#FF0000"] [/color][/size]

[color="#0000ff"][size="2"]please help me?[/size][/color][/font]

memcached =/= memcache

Please explain more?

[font="Times New Roman"][size="3"]I replaced apt-get install php5-memcached to apt-get install php5-memcache and my problem is solved.[/size][/font]

[font="Times New Roman"][size=2]

[/size][/font]

[font="Times New Roman"][size="3"][color="#ff0000"]Thanks,Bizley[/color][/size][/font]