Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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():

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

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

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 doesnt 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 dependecies?

thanks much

share|improve this question

2 Answers 2

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.

share|improve this answer
    
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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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