1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.1 memcached

Discussion in 'Troubleshooting and Problems' started by Marcus, Oct 10, 2012.

  1. Marcus

    Marcus Well-Known Member

    Do I have to add more files from the ZEND framework in order to activate memcache?
    Code:
    An exception occurred: The memcache extension must be loaded for using this backend ! in /var/domain.com/library/Zend/Cache.php on line 209
    Zend_Cache::throwException() in Zend/Cache/Backend/Memcached.php at line 123
    Zend_Cache_Backend_Memcached->__construct() in Zend/Cache.php at line 153
    Zend_Cache::_makeBackend() in Zend/Cache.php at line 94
    Zend_Cache::factory() in XenForo/Application.php at line 587
    XenForo_Application->loadCache()
    call_user_func_array() in XenForo/Application.php at line 780
    XenForo_Application->lazyLoad() in XenForo/Application.php at line 810
    XenForo_Application::get() in XenForo/Application.php at line 1130
    XenForo_Application::getCache() in XenForo/Model.php at line 146
    XenForo_Model->_getCache() in XenForo/Model/DataRegistry.php at line 81
    XenForo_Model_DataRegistry->getMulti() in XenForo/Dependencies/Abstract.php at line 134
    XenForo_Dependencies_Abstract->preLoadData() in XenForo/FrontController.php at line 125
    XenForo_FrontController->run() in /domain.com/index.php at line 13
    Code:
     #netstat -tap | grep memcached
    tcp 0 0 *:memcache *:* LISTEN 12908/memcached
    tcp 0 0 *:memcache *:* LISTEN 12908/memcached
    config.php
    Code:
    (...)
    $config['cache']['backend'] = 'Memcached';
    $config['cache']['backendOptions'] = array(
    'compression' => false,
    'servers' => array(
    array(
    // your memcached server IP /address
    'host' => 'localhost',
     
    // memcached port
    'port' => 12908,
    )
    )
    );
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  3. ENF

    ENF Well-Known Member

    Did you enable memcache in PHP?
     
  4. Marcus

    Marcus Well-Known Member

    I only added the lines in config.php. Do I have to enable it in xenforos APC?
    Thats my config.php, I outcommented the APC backend and removed the /**/ around memcached.
    Code:
    <?php
    $ips = array('1.11.11.11');
    $config['debug'] = (in_array($_SERVER['REMOTE_ADDR'], $ips) ? true : false);
     
    $config['db']['host'] = 'localhost';
    $config['db']['port'] = '3306';
    $config['db']['username'] = 222222;
    $config['db']['password'] = '111111';
    $config['db']['dbname'] = 3333333;
     
    $config['enableGzip'] = false;
    $config['superAdmins'] = 44444;
     
    $config['cache']['enabled'] = true;
    $config['cache']['cacheSessions'] = true;
    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions'] = array(
    'caching' => true,
    'automatic_serialization' => true,
     
    // 'lifetime' => 3600,
    'cache_id_prefix' => 'foro'
    );
     
    $config['cache']['backend'] = 'Apc';
    /*
    $config['cache']['backend'] = 'Memcached';
    $config['cache']['backendOptions'] = array(
    'compression' => false,
    'servers' => array(
    array(
    // your memcached server IP /address
    'host' => 'localhost',
     
    // memcached port
    'port' => 12908,
    )
    )
    );
    */
     
    ini_set('display_errors', true);
    ini_set('display_startup_errors', true);
     
  5. ENF

    ENF Well-Known Member

    Check your phpinfo page to see if memcache support is enabled within PHP.

    Just look for the 'Memcache' block in the phpinfo and be sure it is 'enabled'.

    This line makes me believe memcache isn't enabled within PHP, which has to be done first before being able to use it.

     
    Jake Bunce and Marcus like this.
  6. Marcus

    Marcus Well-Known Member

    Yes, memcache was not started by php. I honestly don't know what to do with my server management company. I asked them to install memcache.
     
  7. Insy

    Insy Well-Known Member

    You're confusing two differents things:
    • Memcached is a cache server as MySQL is a database server.
    • Memcache is a PHP extension as PDO is used to connect to MySQL.
    Installing memcached on your server don't enable Memcache support on PHP. You also must to install the PHP memcache extension.
    Both are required to use Memcache caching with XenForo.
     

Share This Page