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

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);

You might also want to look at these posts

  • Multiple memcache instances/servers on windows
  • Optimizing Drupal 6, Gain Performance and Stability!
  • Google competing with code search sites
  • Message for the Samsung Software Departement: You Suck.
  • xdebug trace file parser
  • 

    One Response (Add Your Comment)

    1. It works! Thanks a lot

    Leave a Reply

    Formatting: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    Archives

    Twitter!