I have install memcached and when I try a script test like this one :
$memcache = new Memcache;
$memcache->connect('127.0.0.1', 11211);
echo $memcache->getVersion();
I recive the nest error :
: Notice: MemcachePool::getversion(): Server 127.0.0.1 (tcp 11211, udp 0) failed with: Network timeout (0) in /var/www/html/admin/test.php on line 62
What could be the problem? I'm new to memcached.
Best Answer
Verify listening
Run
lsof -i
as root and confirm that the memcache daemon is running on the port you listed.Formatted for sanity:
So the memcache server is listening on both TCP and UDP for both IPv4 and IPv6. I assume that the /etc/services entry for memcache is port 11211. Service is listening.
Manually verify the server responds to commands
I'd reference this question: https://stackoverflow.com/questions/6045187/memcache-connects-but-doesnt-respond-to-any-command and verify that the server is responding to commands that you send via telnet or netcat. It will probably also be very helpful if you run tcpdump or wireshark to capture the network traffic and actually see what packets are traveling.
Debug things without changing the memcache configuration first. Attempting to change the server's bind address per that question above should be the last thing you do. Let me know your progress.