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

memcached config

Discussion in 'Server Configuration and Hosting' started by gmaister22, May 24, 2013.

  1. gmaister22

    gmaister22 Active Member

    I just installed memcached and memcache (not sure if its needed to have em both installed, some people say its better to have em both up and running)

    [​IMG]

    That's what i have added in the config file:
    Code:
    $config['cache']['enabled'] = true;
    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions']['cache_id_prefix'] = 'xf_';
    $config['cache']['backend'] = 'Memcached';
    $config['cache']['backendOptions'] = array(
        'compression' => false,
        'servers' => array(
            array(
                // your memcached server IP /address
                'host' => 'localhost',
               
                // memcached port
                'port' => 11211,
            )
        )
    );
    But when i save it, i get "An unexpected Error occurred. Please try again later"

    What's wrong? :S
     
  2. Liam W

    Liam W Well-Known Member

    Did you start memcache?

    Also, I don't believe you installed it. You installed the PECL, but I believe you also have to install the main executable onto the server.
     
    gmaister22 likes this.
  3. The Forum Heroes

    The Forum Heroes Well-Known Member

    You need to install Memcache also not just the .so...

    yum install libevent libevent-devel
    cd /usr/local/src
    wget http://memcached.googlecode.com/files/memcached-1.4.15.tar.gz
    tar xvzf memcached-1.4.15.tar.gz
    cd memcached-1.4.1
    ./configure
    make && make install

    Now start it running this line

    memcached -d -u nobody -m 512 -p 11211 127.0.0.1
     
    gmaister22 likes this.
  4. gmaister22

    gmaister22 Active Member

    Thanks guys :)
     
  5. Earl

    Earl Member

    Do you have multiple servers with a load balancer?
    I've been reading about memcache for while. seems like there is no point installing memcache in a single server environment.
    someone please correct me if i'm wrong
     
  6. Floren

    Floren Well-Known Member

    @Earl, memcached is a must (even on a single server), if you cache the sessions.
    I use it in combination with OPcache in PHP 5.5.7, zero fragmentation. Some reading material, keep going on the thread to see all logic behind.
     
    RoldanLT likes this.

Share This Page