Cannot store values ​​in memcache

I am using apache + php + memcache for suse 10.1.

I can connect Ok to memcached on port 11211, but I can not do getVersion, add, get, etc.

Error message:

[Thu Jan 21 14:38:15 2010] [error] [client] PHP Note: Memcache :: add () [function.Memcache-add]: Localhost server error (tcp 11211): Line error with stream (0) in /testmem/index.php on line 13

How can I debug this?

+4
source share
2 answers

Try 127.0.0.1. Verify that your firewall allows you to connect to port 11211. Verify that the Memcached server is up and running on port 11211.

+1
source

You may be using memcached without ASCII protocol support, for example, if you ran:

$ memcached -B binary

If so, remove the -B argument completely and both PHP and telnet should work.

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

This explains why it works, but you cannot issue ASCII commands via telnet (or PHP).

You can verify this by doing:

$ memcached -S

You should see this output if memcached was not compiled using SASL: "This server is not built with SASL support."

0
source

Source: https://habr.com/ru/post/1298970/


All Articles