Memcached on Windows Vista

Memcached on Windows Vista

If you're planning to use the Windows port of Memcached, be careful how you connect to the server in your code. Using the PHP memcache extension, I tried to connect to localhost:
$memCache->connect('localhost', 11211);
$memCache->set('test', 'Hello, Memory!');
But I couldn't connect. I kept receiving error 10060 - "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond." I checked with netstat, and Memcached was indeed listening on In the end it turned out that localhost was resolving to ::1: (IPV6) rather than the more traditional (IPV4). Specifying the local IP address ('') instead of 'localhost' fixed everything.

(Sidenote for New Zealanders: This sounds like a "get better work stories" advertisement. At first we thought there might have been a compatibility issue, but, in the end, it turned out to be, uh, the refresh rate.)


How did u install memcached on Windows Vista?
I tried to run the command > memcached.exe -d install
with the memcache Win32 binaries but I got the following error message -
failed to install service or service already installed
Are you sure the service isn't already installed then? Have you checked in the management console for a Memcached entry (run 'services.msc' from the run entry in the start menu)?
Smart Guy!
Thanks Dominic.
Thanks mate,

I was about to give up...

Thank you! This solution is for Windows 7 too.
Thanks Dominic....