I'm configuring like:

if ($_SERVER["HTTP_USER_AGENT"] != "") {

$url = parse_url($db_url);
$path = substr($url["path"], 1);

$conf = array(
   'cache_inc' => './sites/all/modules/memcache/memcache.inc',
   'memcache_key_prefix' => $path,
);
}

Sense of the if ($_SERVER["HTTP_USER_AGENT"] != "") is to detect "drush". Otherwise "drush" and "memcache" can't be used together.
The 'memcache_key_prefix' => $path names the prefix to the current database for uniqueness.

Comments

joe-b’s picture

My settingsp.php file $conf is

  $conf = array(
    'cache_inc' => './sites/all/modules/memcache/memcache.inc',
    'memcache_servers' => array('10.77.10.10:11211' => 'default'),
    'memcache_bins' => array('cache' => 'default'),
  );

… but when I set the 'memcache_servers' value I get a

Warning: openlog() expects parameter 3 to be long, string given in /var/www/drupal6/modules/syslog/syslog.module on line 76

and

user warning: Table 'blogs.node_field_instance' doesn't exist query: SELECT * FROM node_field_instance nfi LEFT JOIN node_field nf ON nf.field_name = nfi.field_name WHERE nf.active = 1 AND nfi.widget_active = 1 in /var/www/drupal6/sites/all/modules/cck/content.install on line 187.

Any ideas what might be causing this?

joe-b’s picture

Hmm, I think it's my error my end. Setting the server as localhost is fine, but by IP address of memcache server not - must be my server config. Apologies.

jvandyk’s picture

Status: Active » Closed (fixed)