Code Like Zell

How to install memcached

I am using CentOS release 5; to find what version you are using, enter cat /etc/redhat-release
at a bash prompt. That is not to say that these steps won’t work for other linux distros, I just haven’t tried them. Anyway, when I first tried to install memcached I could not create the Makefile due to a dependence on libevent. So first, from /usr/local/src:

curl -O http://monkey.org/~provos/libevent-1.3e.tar.gz
tar xzvf libevent-1.3e.tar.gz
cd libevent-1.3e
./configure --prefix=/usr/local
make
make install

Hopefully everything went smoothly for you there. Now on to getting memcached, again from /usr/local/src:

curl -O http://www.danga.com/memcached/dist/memcached-1.2.2.tar.gz
tar xzvf memcached-1.2.2.tar.gz
cd memcached-1.2.2
LDFLAGS='-Wl,--rpath /usr/local/lib' ./configure --prefix=/usr/local
make
make install

Now:

memcached -d -u root

No errors, let’s make sure it’s running:

ps aux | grep memcached

Awesome! Hey, that’s the name of the blog, how unoriginal.

Now to stop it:

pkill memcached

I hope that saved you some time.

For those curious as to what that LDFLAGS='-Wl,--rpath /usr/local/lib' is all about, enter at a bash prompt man ld

This post prevents the following errors:
configure: error: libevent is required
If It’s already installed, specify its path using –with-libevent=/dir/
memcached: error while loading shared libraries: libevent-1.3e.so.1: cannot open shared object file: No such file or directory

Thanks for reading, now find something to do at GoLark.com


8 Comments

hey this worked perfectly im using
Red Hat Enterprise Linux ES release 4
the only change i made was to download the latest memcached stable
1. curl -O http://www.danga.com/memcached/dist/memcached-1.2.3.tar.gz

thanks for the help

Posted by Soldair on 16 March 2008 @ 3pm

worked like a charm. thanks!

Posted by Marshall on 20 March 2008 @ 11am

Hi,
thanks a lot for help me….
once again thanks.if u configure all the installation file which are neew for LAMP(Linux,Apache,Mysql and PHP) then its a very nice..
Thanks & Regards
Sumanta Dash

Posted by sumanta on 2 April 2008 @ 10am

after this command: # LDFLAGS=’-W1,–rpath /usr/local/lib’ ./configure –prefix=/usr/local
i have this error:
checking build system type… x86_64-unknown-linux-gnu
checking host system type… x86_64-unknown-linux-gnu
checking target system type… x86_64-unknown-linux-gnu
checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking for gawk… gawk
checking whether make sets $(MAKE)… yes
checking for gcc… gcc
checking for C compiler default output file name…
configure: error: C compiler cannot create executables
See `config.log’ for more details.

Since Im new in linux, i can’t continue the next step which is make && make install..

Please somebody sare response..
Thanks

Posted by jayjay on 10 April 2008 @ 3am

Whoa haven’t been back in a while. Glad it helped you guys. Jayjay this was on a 32 bit machine. I hope you found an answer in the last 2 months.

Posted by lou on 29 June 2008 @ 8pm

Hi,

I would like to correct this “cd memcached-1.2.2.tar.gz” i think u made a mistake its suppose to be “cd memcached-1.2.2″

Posted by Steven Mtsweni on 8 August 2008 @ 8am

Steven, thank you, I have fixed this in the post.

Posted by lou on 8 August 2008 @ 1pm

That is awesome. I’ve set-up memcached before, but it always seemed so complicated.
Not anymore!

Posted by pedalpete on 21 November 2008 @ 2am

Leave a Comment

How to use javascript to hijack the enter key Optimizing Ruby Time Creation with Time.local