MyBB Community Forums

Full Version: memcache problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i already install memcache in my vps
and change forum cache handler to memcache from db
but my forum shown error if open showthread
check this out
http://www.kikil.org/forum/showthread.ph...pid=391603


Warning [2] Invalid argument supplied for foreach() - Line: 61 - File: inc/cachehandlers/memcache.php PHP 5.3.2 (Linux)
File Line Function
/inc/cachehandlers/memcache.php 61 errorHandler->error
/inc/class_datacache.php 71 memcacheCacheHandler->connect
/inc/init.php 149 datacache->cache
/global.php 19 require_once
/showthread.php 22 require_once
Warning [2] Memcache::get() [memcache.get]: No servers added to memcache connection - Line: 101 - File: inc/cachehandlers/memcache.php PHP 5.3.2 (Linux)
File Line Function
[PHP] errorHandler->error
/inc/cachehandlers/memcache.php 101 Memcache->get
/inc/class_datacache.php 107 memcacheCacheHandler->fetch
/inc/init.php 192 datacache->read
/global.php 19 require_once
/showthread.php 22 require_once
Warning [2] Memcache::set() [memcache.set]: No servers added to memcache connection - Line: 122 - File: inc/cachehandlers/memcache.php PHP 5.3.2 (Linux)
File Line Function
[PHP] errorHandler->error
/inc/cachehandlers/memcache.php 122 Memcache->set
/inc/class_datacache.php 123 memcacheCacheHandler->put
/inc/init.php 192 datacache->read
/global.php 19 require_once
/showthread.php 22 require_once
Warning [2] Memcache::get() [memcache.get]: No servers added to memcache connection - Line: 101 - File: inc/cachehandlers/memcache.php PHP 5.3.2 (Linux)
File Line Function
[PHP] errorHandler->error
/inc/cachehandlers/memcache.php 101 Memcache->get
/inc/class_datacache.php 107 memcacheCacheHandler->fetch
/inc/init.php 210 datacache->read
/global.php 19 require_once
/showthread.php 22 require_once
Warning [2] Memcache::set() [memcache.set]: No servers added to memcache connection - Line: 122 - File: inc/cachehandlers/memcache.php PHP 5.3.2 (Linux)
File Line Function
[PHP] errorHandler->error
/inc/cachehandlers/memcache.php 122 Memcache->set
/inc/class_datacache.php 123 memcacheCacheHandler->put
/inc/init.php 210 datacache->read
/global.php 19 require_once
/showthread.php 22 require_once
Warning [2] Memcache::get() [memcache.get]: No servers added to memcache connection - Line: 101 - File: inc/cachehandlers/memcache.php PHP 5.3.2 (Linux)
File Line Function
[PHP] errorHandler->error
/inc/cachehandlers/memcache.php 101 Memcache->get
/inc/class_datacache.php 107 memcacheCacheHandler->fetch
/inc/class_plugins.php 36 datacache->read
/inc/init.php 223 pluginSystem->load
/global.php 19 require_once
/showthread.php 22 require_once
Warning [2] Memcache::set() [memcache.set]: No servers added to memcache connection - Line: 122 - File: inc/cachehandlers/memcache.php PHP 5.3.2 (Linux)
File Line Function
[PHP] errorHandler->error
/inc/cachehandlers/memcache.php 122 Memcache->set
/inc/class_datacache.php 123 memcacheCacheHandler->put
/inc/class_plugins.php 36 datacache->read
/inc/init.php 223 pluginSystem->load
/global.php 19 require_once
/showthread.php 22 require_once
Warning [2] Memcache::get() [memcache.get]: No servers added to memcache connection - Line: 101 - File: inc/cachehandlers/memcache.php PHP 5.3.2 (Linux)
File Line Function
[PHP] errorHandler->error
/inc/cachehandlers/memcache.php 101 Memcache->get
/inc/class_datacache.php 107 memcacheCacheHandler->fetch
/global.php 24 datacache->read
/showthread.php 22 require_once
Warning [2] Memcache::set() [memcache.set]: No servers added to memcache connection - Line: 122 - File: inc/cachehandlers/memcache.php PHP 5.3.2 (Linux)
File Line Function
[PHP] errorHandler->error
/inc/cachehandlers/memcache.php 122 Memcache->set
/inc/class_datacache.php 123 memcacheCacheHandler->put
/global.php 24 datacache->read
/showthread.php 22 require_once
Warning [2] Memcache::get() [memcache.get]: No servers added to memcache connection - Line: 101 - File: inc/cachehandlers/memcache.php PHP 5.3.2 (Linux)
File Line Function
[PHP] errorHandler->error
/inc/cachehandlers/memcache.php 101 Memcache->get
/inc/class_datacache.php 107 memcacheCacheHandler->fetch
/inc/functions.php 4719 datacache->read
/inc/plugins/xthreads.php 300 get_forum
[PHP] xthreads_global
/inc/class_plugins.php 101 call_user_func_array
/global.php 95 pluginSystem->run_hooks
/showthread.php 22 require_once
Warning [2] Memcache::set() [memcache.set]: No servers added to memcache connection - Line: 122 - File: inc/cachehandlers/memcache.php PHP 5.3.2 (Linux)
File Line Function
[PHP] errorHandler->error
/inc/cachehandlers/memcache.php 122 Memcache->set
/inc/class_datacache.php 123 memcacheCacheHandler->put
/inc/functions.php 4719 datacache->read
/inc/plugins/xthreads.php 300 get_forum
[PHP] xthreads_global
/inc/class_plugins.php 101 call_user_func_array
/global.php 95 pluginSystem->run_hooks
/showthread.php 22 require_once
Have you also set the correct values for $config['memcache']['host'] and $config['memcache']['port'] in the config file?

The first error you're getting about foreach points to this configuration not being set or being incorrect.
You have to set your memcache server in inc/config.php.
(2011-04-27, 07:22 AM)Joshua Mayer Wrote: [ -> ]Honestly, I am not sure about this one. Toungue There are about 10 mentions to plugins though, so try disabling your plugins by doing the following:

In ./inc/init.php, find the code:

define("TIME_NOW", time());

After this code, add this:

define("NO_PLUGINS", 1);

Then save and/or reupload this edited version of the file so the forum will run the new code.

If the error goes after this, then a plugin (xthreads I believe...) is causing this.

thanks for help
already edit init.php and try to deactive xthread, but still shown error, how then?
(2011-04-27, 07:31 AM)StefanT Wrote: [ -> ]You have to set your memcache server in inc/config.php.

yes already, that why mybb read memcache configuration and shown error


(2011-04-27, 07:30 AM)- G33K - Wrote: [ -> ]Have you also set the correct values for $config['memcache']['host'] and $config['memcache']['port'] in the config file?

The first error you're getting about foreach points to this configuration not being set or being incorrect.

i using memcache default configuration, and i believed that port and hostname is still default localhost and port 11211
Can you post that part of your config.php. Begining from $config['cache_store'] to $config['memcache']['port']
(2011-04-27, 07:49 AM)- G33K - Wrote: [ -> ]Can you post that part of your config.php. Begining from $config['cache_store'] to $config['memcache']['port']
$config['cache_store'] = 'memcache';

/**
 * Memcache configuration
 *  If you are using memcache as your data-cache,
 *  you need to configure the hostname and port
 *  of your memcache server below.
 *
 * If not using memcache, ignore this section.
 */

$config['memcache_host'] = 'localhost';
$config['memcache_port'] = 11211;
It should be:
$config['memcache']['host'] = 'localhost';
$config['memcache']['port'] = 11211;
nice! it work like a charm now!.
many thanks for StefanT and all Mybb support who help me in this thread! great !