Setting: Apache; PHP 5.2.9; libevent (required for memcached) version 1.3; memcached server version 1.2.2 (tried 1.4.5, 1.4.0, now downgraded to 1.2.2, there is no difference); Memcached php pecl module version 2.2.6.
Problem:
Like unsolved problems cannot store values ββin memcache and Super strange PHP error
None of these threads resolved the problem, and none of the authors of the questions complied with the recommendations given. I followed them and it still does not work.
Memcache code does not show any errors if I connect via PHP, but as soon as I try to execute any command (for example, getVersion ), I get the answer:
Notice: memcache_get_version() [function.memcache-get-version]: Server 127.0.0.1 (tcp 11211) failed with: Failed reading line from stream (0) in /var/www/html/memcache.php on line 11
Solutions:
Connecting to memcache via the command line does not work. After I type any command connection, it closes.
[/usr/local/src]$ telnet 127.0.0.1 11211 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. stats Connection closed by foreign host.
I tried $ memcached -S to make sure memcached was compiled with SASL support disabled. Answer: "This server is not built with SASL support."
In addition, one of the comments was
You may be using memcached without ASCII protocol support, for example, if you ran:
$ memcached -B binary
If so, remove the -B argument entirely and both PHP and telnet should work.
Memcache start line:
memcached -d -m 1024 -u root -l 127.0.0.1 -p 11211
There is no argument B in it.
Any ideas?