Memcache localhost connection oddity

Posted by MatW on Stack Overflow See other posts from Stack Overflow or by MatW
Published on 2010-06-06T00:51:34Z Indexed on 2010/06/06 0:52 UTC
Read the original article Hit count: 292

Filed under:
|
|

When I try to connect to memcache using this code:

$memcache = new Memcache;
$memcache->connect('localhost', 11211) or die ("Could not connect");

The call dies with the "Could not connect" error, but if I use localhost's IP:

$memcache = new Memcache; 
$memcache->connect('127.0.0.1', 11211) or die ("Could not connect");

It works! So what's my problem? Well, this new computer is the only development environment I've setup that's been sensitive to that difference. I'm not about to go changing the settings on any code for what seems to be a computer specific issue, but I can't figure out what could be causing this behaviour... Any ideas?

I'm running XP, memcached 1.2.4, and wampserver 2. I've checked the hosts file and it does have an entry for localhost.

© Stack Overflow or respective owner

Related posts about windows-xp

Related posts about memcached