Hi all,
I have memcached running locally and on another server (via vpn), I can successfully communicate with either server from phalcon using the code below:
$memcache = new Memcached;
$memcache->addServer('memcache.server.com',11211);
echo $memcache->save('trackinglink-50164','https://www.google.com',60;
echo $memcache->get('trackinglink-50164');
However using Phalcon libmemcached I get:
Uncaught Phalcon\Cache\Exception: Failed storing data in memcached, error code: 47
Here is my service:
$di->set('cache', function () {
$frontCache = new FrontData(
array(
'lifetime' => 86400,
)
);
$cache = new \Phalcon\Cache\Backend\Libmemcached($frontCache, array(
"servers" => array(
array('host' => 'memcache.server.com',
'port' => 11211,
'weight' => 1),
),
"client" => array(
Memcached::OPT_HASH => Memcached::HASH_MD5,
Memcached::OPT_PREFIX_KEY => '',
)
));
return $cache;
})
Here is a print_r of $cache:
Phalcon\Cache\Backend\Libmemcached Object
(
[_frontend:protected] => Phalcon\Cache\Frontend\Data Object
(
[_frontendOptions:protected] => Array
(
[lifetime] => 86400
)
)
[_options:protected] => Array
(
[servers] => Array
(
[0] => Array
(
[host] => memcache.server.com
[port] => 11211
[weight] => 1
)
)
[client] => Array
(
[2] => 1
[-1002] =>
)
[statsKey] =>
)
[_prefix:protected] =>
[_lastKey:protected] =>
[_lastLifetime:protected] =>
[_fresh:protected] =>
[_started:protected] =>
[_memcache:protected] =>
)
trying the code below triggers the error:
$cache = Di::getDefault()->getCache();
$cache->save('mydata',array(1,2,3));
I can also telnet to either server, set and get keys just fine.... funny is, code above was working before and all of a sudden I keep getting this error 47 and can no longer do anything....
Can anyone help?