Closed (fixed)
Project:
Memcache API and Integration
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Oct 2011 at 11:01 UTC
Updated:
1 May 2013 at 12:50 UTC
When accessing page ***/admin/reports/memcache
I got the following warnings and notices:
Notice: Undefined variable: stats in dmemcache_stats() (line 243 of /***/sites/all/modules/contrib/memcache/dmemcache.inc).
Warning: Invalid argument supplied for foreach() in dmemcache_stats() (line 243 of /***/sites/all/modules/contrib/memcache/dmemcache.inc).
Notice: Undefined variable: stats in dmemcache_stats() (line 262 of /***/sites/all/modules/contrib/memcache/dmemcache.inc).
There are no statistics being reported for this bin.
Drupal 7.8
Comments
Comment #1
Refineo commentedIt works fine now without doing anything specific. I don't know what was the reason for this error.
Comment #2
socialnicheguru commentedI have the same errors
Notice: Undefined variable: stats in dmemcache_stats() (line 244 of /var/aegir/platforms/7/modules/all/memcache/dmemcache.inc).
Warning: Invalid argument supplied for foreach() in dmemcache_stats() (line 244 of /var/aegir/platforms/7/modules/all/memcache/dmemcache.inc).
Notice: Undefined variable: stats in dmemcache_stats() (line 263 of /var/aegir/platforms/7/modules/all/memcache/dmemcache.inc).
There are no statistics being reported for this bin.
is there a bin that is not being utalized or configured since I am getting that error.
Comment #3
fayedrupal commentedAt settings.php of your drupal site ( normally at /sites/default/settings.php )
This is the foreach() error you may set wrongly in settings.php , if you use more than one memcache you need to specify the array of memcache instances, if you use only one memcache and as a default localhost:11211 you no need to set the ['memcache_servers']
$conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc';
$conf['cache_default_class'] = 'MemCacheDrupal';
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
for 2 memcached instances example:
$conf['memcache_servers'] = array(
'10.1.1.1:11211' => 'default',
'10.1.1.1:11212' => 'pages'
);
$conf['memcache_bins'] = array(
'cache' => 'default',
'cache_page' => 'pages'
);
AWS Elasti Cache example:
$conf['memcache_servers'] = array(
'mycache.xxxxx.0001.euw1.cache.amazonaws.com:11211' => 'default',
'mycache.xxxxx.0002.euw1.cache.amazonaws.com:11211' => 'pages'
);
$conf['memcache_bins'] = array(
'cache' => 'default',
'cache_page' => 'pages'
);
see http://drupal.org/node/1131468 for more memcached instances setting
remember to set your security rules in iptables to prevent hack via memcached instance
This is my first comment in drupal, hope you like it.
Comment #4
markpavlitski commentedMarking as fixed, please feel free to re-open if the feedback above hasn't resolved the issue.