I have Memcache API installed and working - I can see my Memcache Stats. When I install Cache Router I can enable the module without issue. However when I add the following code to my settings.php file:

$conf['cache_inc'] = './sites/all/modules/cacherouter/cacherouter.inc';
$conf['cacherouter'] = array(
  'default' => array(
    'engine' => 'memcache',
    'server' => array('localhost:11211','localhost:11212','localhost:11213','localhost:11214','localhost:11215','localhost:11216'),
    'shared' => TRUE,
    'prefix' => '',
    'path' => 'sites/default/files/filecache',
    'static' => FALSE,
    'fast_cache' => TRUE,
  ),
);

I get the following error:

Fatal error: Call to undefined function dmemcache_stats() in C:\www\drupal\sites\all\modules\memcache\memcache_admin\memcache_admin.module on line 115

So it doesn't seem to want to work with memcache.

Any suggestions?

-backdrifting

Comments

ambientdrup’s picture

Ok, I've removed this line from the settings.php file and now the memcache stats are showing again and I'm not getting a parse error.

removed:

$conf['cache_inc'] = './sites/all/modules/cacherouter/cacherouter.inc';

I also have this in my settings.php file according to how to set up Memcache API:


$conf = array(
   // The path to wherever memcache.inc is. The easiest is to simply point it
   // to the copy in your module's directory.
  'cache_inc' => './sites/all/modules/memcache/memcache.inc',
   // or
   // 'cache_inc' => './sites/all/modules/memcache/memcache.db.inc',
);

So there seems to be some conflict going on. Is my Cache Router actually working now?

How can I tell?

-backdrifting

adamo’s picture

Cache Router and Memcache API modules are not meant to be used together. Cache Router has it's own memcache implementation. Use one or the other, not both.

By removing "$conf['cache_inc'] = './sites/all/modules/cacherouter/cacherouter.inc';" you are effectively disabling cache_router.

The dmemcache_stats() is from dmemcache.inc which gets included by memcache.inc or memcache.db.inc. When you set the above line for cache_router, that caused the memcache include file not to be loaded, which the memcache_admin module depends on.

This is the config I'm currently using for memcache via Cache Router:

$conf['cache_inc'] = './sites/all/modules/cacherouter/cacherouter.inc';
$conf['cacherouter'] = array(
  'default' => array(
    'engine' => 'memcache',
    'server' => 'localhost:11211',
    'shared' => TRUE,
    'prefix' => 'beta',
  ),
);
ambientdrup’s picture

Thanks. Yes I figured it out.

-backdrifting

crea’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.