Recently I want to write some programs on the C language server, so I want to install memcached and libmemcached on Ubuntu. I. Install software 1 // install memcached2sudoapt-getinstallmemcached3 // install libevent-dev4sudoapt-getinstalllibevent-dev
Recently I want to write some programs on the C language server, so I want to install memcached and libmemcached on Ubuntu.
1. Install software
1 // install memcached
2 sudo apt-get install memcached
3 // install libevent-dev
4 sudo apt-get install libevent-dev
5 // This is very important, otherwise libmemcached will not be able to run
6 sudo ln-s/usr/local/lib/libmemcached. so.3/usr/lib/libmemcached. so.3
Then download the libmemcached-0.34 and install.
./Configure, if your Memcached is not the default installation path, it will report
Configure: error: "cocould not find memcached binary"
The following command can solve this problem.
./Configure-with-memcached =/home/app/memcached/bin/memcached
2. Start and test the software
Run memcached
1 memcached-d-m 64-l 127.0.0.1-p 11211
Create a test data file in the current directory or run
1 echo "test memcached"> data
Then test
1 // cache data file data
2 memcp data -- servers = 127.0.0.1: 11211
3 // get the data file
4 memcat data -- servers = 127.0.0.1: 11211
The console displays
1 test memcached
------------
Actually, use SHELL commands
Sudo apt-get install libmemcached-tools
You can.