I have installed memcached on my Debian Wheezy box, it runs on 11211 port (I can telnet to it and get STATs), php extensions are installed (memcache & memcached) and I run this:
<?php
//error_reporting(E_ALL & ~E_NOTICE);
$mc = new Memcached();
var_dump($mc->getResultCode()); // returns 0
$result = $mc->addServer("localhost", 11211);
var_dump($result); // returns TRUE
var_dump($mc->getStats()); // returns nulled stats
$result = $mc->set("foo", "Hello!");
var_dump($mc->getResultCode()); // returns MEMCACHED_SERVER_TEMPORARILY_DISABLED
echo $mc->set("bar", "Memcached...");
var_dump($mc->getResultCode());
$arr = array(
$mc->get("foo"),
$mc->get("bar")
);
var_dump($arr);
?>
I've tried to run memcached deamon as the current website owner (-u www-data in /etc/memcache) but it doesn't help and I can't find anything usable about this MEMCACHED_SERVER_TEMPORARILY_DISABLED code. Any ideas what might be broken / misconfigured?
I'm using PHP 5.4 + nginx 1.5.8 + eAccelerator.