I have been trying to implement memcached in my application built in fat free framework. I have read that it should be explicitly defined as "memcached=192.168.--.---:11211" but no matter how I implement it, it uses "folder=tmp/cache/"
Tried and failed approaches
config.ini
CACHE="memcached=192.168.--.---:11211"
index.php
$f3->config('config/config.ini');
$f3->run();
code
$cache = \Cache::instance();
var_dump($cache);
Output
Object(Cache)#7 (3) {
["dsn":protected] => string(17)"folder=tmp/cache/"
["prefix":protected] => string(12)"randomString"
["ref":protected] => NULL
}
code
$cache = \Cache::instance();
$cache->load("memcached=192.168.--.---:11211");
var_dump($cache);
Output
Object(Cache)#7 (3) {
["dsn":protected] => string(17)"folder=tmp/cache/"
["prefix":protected] => string(12)"randomString"
["ref":protected] => NULL
}
code
$cache = new Cache("memcached=192.168.--.---:11211");
var_dump($cache);
Output
Object(Cache)#7 (3) {
["dsn":protected] => string(17)"folder=tmp/cache/"
["prefix":protected] => string(12)"randomString"
["ref":protected] => NULL
}
index.php
$f3->config('config/config.ini');
$f3->set('CACHE',"memcached=192.168.--.---:11211");
var_dump($f3->get('CACHE'));
Output
string(17)"folder=tmp/cache/"
What am I missing?
Do you have installed the proper php extension? Or is the connection secured? Because when there’s an error, the cache engine will just fall back to folder mode.