Install memcached and libmemcached on Ubuntu

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.