Skip to content

Instantly share code, notes, and snippets.

@kennethreitz
Created April 22, 2010 05:55
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kennethreitz/374871 to your computer and use it in GitHub Desktop.
Save kennethreitz/374871 to your computer and use it in GitHub Desktop.
Install memcache on a MediaTemple (dv)
wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rpm --install rpmforge-release-0.3.6-1.el5.rf.i386.rpm
yum install --enablerepo=rpmforge memcached
memcached -d -m 512 -l 127.0.0.1 -p 11211 -u nobody
wget http://pecl.php.net/get/memcache-2.2.5.tgz
tar -xvf memcache-2.2.5.tgz
cd memcache-2.2.5
phpize && ./configure --enable-memcache && make
cp /root/memcache-2.2.5/modules/memcache.so /usr/lib/php/modules/
echo extension=memcache.so >> /etc/php.ini
/etc/init.d/httpd restart
@jessehs
Copy link

jessehs commented Jan 15, 2014

I got the error message: package rpmforge-release-0.5.2-2.el5.rf.x86_64 (which is newer than rpmforge-release-0.3.6-1.el5.rf.x86_64) is already installed

I visited http://wiki.centos.org/AdditionalResources/Repositories/RPMForge to get the latest version and replaced it.

Next, the error message was file /etc/yum.repos.d/rpmforge.repo from install of rpmforge-release-0.5.3-1.el5.rf.x86_64 conflicts with file from package rpmforge-release-0.5.2-2.el5.rf.x86_64

The solution was to run rpm -U rpmforge-release-0.5.2-2.el5.rf.x86_64

Then the command was yum --enablerepo=rpmforge,rpmforge-extras install memcached

@jessehs
Copy link

jessehs commented Jan 16, 2014

I also needed to install gcc: yum install gcc while running as root.

You can download the latest memcached version by running pecl install memcached, but the install fails, because the /tmp directory is not mounted as executable. You can copy the downloaded memcached dir by running cp -R /tmp/pear/download/memcache-2.2.7/ /root/memcache-2.2.7

Then change to that directory and run the command in line 8.

As of this version, memcache installs a script in /etc/init.d/memcached so you can start it by running /etc/init.d/memcached start

@vinniefranco
Copy link

Quick note: On a dv 3.x server I had to use /usr/lib64/php/modules

@Teevio
Copy link

Teevio commented Mar 10, 2014

I can confirm this worked on the (dv) 4.0 with the one small path edit that @vinniefranco mentioned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment