3

Situation: I installed memcached on a CenTOS 5 (64 bit). I also ended up installing some PHP plugins using PECL, though they're unnecessary now.

Problem:When I execute

/etc/init.d/memcached start

I get the following error:

Starting memcached: memcached: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory

But the file libevent-2.0.so.5 is present in /opt/couchbase/lib/.

Should it be there in some other folder ? How to get memcached to start ?

Abhishek
  • 743
  • 1
  • 15
  • 28

2 Answers2

3

/opt/couchbase/lib will not be set on your system library path by default. That's why your unable to find libevent when running /etc/init.d/memcached.

To quickly solve this you can just run the command as follows:

LD_LIBRARY_PATH=/opt/couchbase/lib /etc/init.d/memcached

or to solve this over the long term add the following file (assuming your using centos):

/etc/ld.so.conf.d/couchbase.conf

and in that file add the path "/opt/couchbase/lib". Then run ldconfig and re-run the command to start memcached.

mikewied
  • 5,273
  • 1
  • 20
  • 32
1

sudo ln -s /usr/lib/libevent-2.1.so.6 /usr/lib64/libevent-2.1.so.6

for libevent-2.0.so.5 the same.

Michael Popovich
  • 301
  • 1
  • 10