tags:

views:

351

answers:

1

Hi,

I am running apache+php+memcache on suse 10.1. I can connect Ok to memcached on port 11211, but I cannot do getVersion, add, get, etc.

Error message
[Thu Jan 21 14:38:15 2010] [error] [client ] PHP Notice:  Memcache::add() [<a href='function.Memcache-add'>function.Memcache-add</a>]: Server localhost (tcp 11211) failed with: Failed reading line from stream (0) in /testmem/index.php on line 13

How can I debug this?

Thanks

A: 

You may be running memcached without ASCII protocol support, such as if you ran:

$ memcached -B binary

If this is the case, remove the -B argument entirely, and PHP and telnet should work.

It is also possible that your memcached was compiled with SASL support enabled, which disabled the ASCII protocol that PHP requires to connect to memcached.

This would explain why it is running, but you cannot issue ASCII commands through telnet (or PHP).

You could test this by running:

$ memcached -S

You should see this output if memcached wasn't compiled with SASL: "This server is not built with SASL support."

Keith Minkler