I know there are other questions on this but I can't find a resolution.

I've installed Memcached on a server running Ubuntu and I'm trying to use it.

I've attempted to start it using:

$ memcached -d -p 11211

I cannot access it using the PHP client from scripts or from Telnet o server 11211

Port 11211 is forwarded from the router.

What do I need to do to get it to work?

Edit: I've since enabled ufw and added the ports to be allowed with no difference made to the result.


Check memcached process:

$ ps aux | grep -E "[m]emcached"
hiemye     921  0.0  0.3  44040   868 ?        Ssl  12:31   0:00 memcached -d -p 11211

Check listen address:

$ lsof -np `pgrep memcached`
memcached 921 hiemye   26u  IPv4       4449      0t0    TCP *:11211 (LISTEN)
memcached 921 hiemye   27u  IPv6       4450      0t0    TCP *:11211 (LISTEN)
memcached 921 hiemye   28u  IPv4       4453      0t0    UDP *:11211 
memcached 921 hiemye   29u  IPv6       4454      0t0    UDP *:11211

Add allow ufw rules:

ufw allow in proto tcp from to port 11211 - client ip - server ip
  • It doesn't appear to be on properly. Is it not working because I'm trying to access it over a network rather than from php sat on the same server? – user34542 Dec 8 '10 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy