memcache_connect() [function.memcache-connect]: Can’t connect to localhost:11211

by Thomas Hambach

Encountered this error? It could be as simple as switching the host from localhost to 127.0.0.1

before:

<?php 
$memcache_obj = memcache_connect('localhost', 11211);

after:

<?php
$memcache_obj = memcache_connect('127.0.0.1', 11211);