Want to subscribe to topics you're interested in?
Become a Member

Xenforo Xenforo Redis Cache - An unexpected error has occurred.

Discussion in 'Forum software usage' started by tdubs, Oct 11, 2015.

  1. tdubs

    tdubs Member

    83
    12
    8
    Apr 10, 2015
    Ratings:
    +15
    Local Time:
    4:54 AM
    1.7.12
    10.0.17
    Hello,

    I followed the tutorial located at Redis - How to install Redis server on Centmin Mod LEMP stack | Centmin Mod Community and noticed once I made the change in my config.php then flushing redis-cli, my forum outputs "An unexpected error has occurred. Please try again later." When I switched back to Libmemcached in my ocnfig, I noticed this error in my server error logs:

    Redis 'server' not specified.

    Error Info
    Code:
    Zend_Cache_Exception: Redis 'server' not specified. - library/Zend/Cache.php:209
    Generated By: Unknown Account, 1 minute ago
    Stack Trace
    Code:
    #0 /home/nginx/domains/domain.com/public/library/Redis/Cm/Cache/Backend/Redis.php(113): Zend_Cache::throwException('Redis 'server' ...')
    #1 /home/nginx/domains/domain.com/public/library/Zend/Cache.php(153): Cm_Cache_Backend_Redis->__construct(Array)
    #2 /home/nginx/domains/domain.com/public/library/Zend/Cache.php(94): Zend_Cache::_makeBackend('Redis', Array, false, false)
    #3 /home/nginx/domains/domain.com/public/library/XenForo/Application.php(762): Zend_Cache::factory('Core', 'Redis', Array, Array)
    #4 [internal function]: XenForo_Application->loadCache(Object(Zend_Config))
    #5 /home/nginx/domains/domain.com/public/library/XenForo/Application.php(971): call_user_func_array(Array, Array)
    #6 /home/nginx/domains/domain.com/public/library/XenForo/Application.php(1002): XenForo_Application->lazyLoad('cache', NULL)
    #7 /home/nginx/domains/domain.com/public/library/XenForo/Application.php(1647): XenForo_Application::get('cache')
    #8 /home/nginx/domains/domain.com/public/library/XenForo/Model.php(146): XenForo_Application::getCache()
    #9 /home/nginx/domains/domain.com/public/library/XenForo/Model/DataRegistry.php(81): XenForo_Model->_getCache(true)
    #10 /home/nginx/domains/domain.com/public/library/XenForo/Dependencies/Abstract.php(147): XenForo_Model_DataRegistry->getMulti(Array)
    #11 /home/nginx/domains/domain.com/public/library/XenForo/FrontController.php(127): XenForo_Dependencies_Abstract->preLoadData()
    #12 /home/nginx/domains/domain.com/public/index.php(13): XenForo_FrontController->run()
    #13 {main}
    Request State
    Code:
    array(3) {
    ["url"] => string(45) "http://www.domain.com/index.php?tabalerts"
    ["_GET"] => array(1) {
    ["tabalerts"] => string(0) ""
    }
    ["_POST"] => array(4) {
    ["_xfRequestUri"] => string(38) "/index.php?threads/false-banning.7922/"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfResponseType"] => string(4) "json"
    }
    }
    Here is my config.php
    Code:
    <?php
    
    $config['db']['host'] = 'localhost';
    $config['db']['port'] = '3306';
    $config['db']['username'] = 'xxx';
    $config['db']['password'] = 'xxx';
    $config['db']['dbname'] = 'xxx';
    
    $config['superAdmins'] = '1,4,15';
    
    // Cache
    $config['cache'] = array(
        'enabled'                      => true,
        'cacheSessions'                => true,
        'frontend'                     => 'Core',
        'frontendOptions'              => array(
            'caching'                  => true,
            'cache_id_prefix'          => 'xf_',
            'automatic_serialization'  => true,
            'lifetime'                 => 0),
        'backend'                      => 'Redis',
        'backendOptions'               => array(
            'servers'                  => array(
                array(
                    'host'             => '127.0.0.1',
                    'port'             => 6379,
                    'weight'           => 1
                )
            )
        )
    );
    require(XenForo_Application::getConfigDir().'/SV/RedisCache/Installer.php');
    // End Cache
    
    if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) { $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP']; }
    
    // $config['enableListeners'] = 0;
    Any idea what I'm doing wrong? Thanks!
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,193
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,143
    Local Time:
    4:54 AM
    Nginx 1.13.x
    MariaDB 5.5
    could be the format, this is what i use
    PHP:
    $config['cache']['enabled'] = true;
    $config['cache']['cacheSessions'] = true;
    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions'] = array(
    'caching' => true,
    'cache_id_prefix' => 'xfxx_',
    'automatic_serialization' => false,
    'lifetime' => 0
    );

    $config['cache']['backend'] = 'Redis';

    $config['cache']['backendOptions'] = array(
    'server' => '127.0.0.1',
    'port' => 6379,
    );
    require(
    XenForo_Application::getConfigDir().'/SV/RedisCache/Installer.php');
     
    • Like Like x 1
  3. tdubs

    tdubs Member

    83
    12
    8
    Apr 10, 2015
    Ratings:
    +15
    Local Time:
    4:54 AM
    1.7.12
    10.0.17
    Thanks. This worked! :)
     
    • Like Like x 1