I am running ubuntu gutsy(7.1) , php5 and I am trying to get memcached running locally. I installed everything as per the docs: memcached daemon, php PECL extension, libevent, etc.

But now I can only run half of the example script for memcached append():

$m = new Memcached();
$m->addServer('localhost', 11211);
$m->setOption(Memcached::OPT_COMPRESSION, false);

$m->set('foo', 'abc');
$m->append('foo', 'def');

The script terminates @ append() with an RES_BAD_PROTOCOL error message. It still runs the get(). I don't know why memcached would otherwise be working fine (connect, set, get - with the correct value of 'abc') and not work for append.

It also doesn't work with prepend.

I believe I have the setup correct, but I am not sure. Maybe there are compatibility problems between the versions of the dependencies?


Whoops. I just had a very old version of memcached installed. 1.2 something. Installed the newer one from source. I must have gotten the old one from an ubuntu repository. (new is version 1.4 something)

Not sure which version the append() and prepend functions were added.

Bad protocol means that the daemon doesn't understand the command, versus a server or client error.... which I believe is a different error code.

  • Ubuntu 7.10 (Gutsy) is very old and unsupported. Newer versions of memcached are available in upgraded versions. I'd recommend upgrading the OS if you get a chance, as you'll be missing security updates for all the system components. If you need long term stable systems, LTS releases are what you should be using, which are supported for 5 years on servers. 6.06, 8.04 and the upcoming 10.04 are all LTS releases. – jldugger Mar 29 '10 at 6:47

Protocol append is actually more of a command used within a protocol rather than an actual standalone protocol.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.