tutorial on installing libmemcached extensions for php5.3

Source: Internet
Author: User
Tags hash key string memcached php memcached versions

Libmemcached is a memcached library, client library, C and C + + language implementation of the client library, with low memory footprint, thread safety, and provide full support for memcached functionality. It also uses a variety of command-line tools: Memcat, Memflush, MEMRM, MemStat, and memslap (load generation). Library is has been designed so that different hashing methods pair the key, split the key, and use a uniform hash allocation

Hash consistent storage

Multi Get/set

Automatically the key hash is int, avoiding the limit of the default of Memcache key string less than 255Byte
For a long time did not configure the server, always thought that libmemcached PHP memcached has been included in the basic installation package, in the end also need to compile their own. The whole installation process a lot of dark pits, tried several times before succeeding

Installation in two steps

Install libmemcached, target so and header files
Install memcachedphp Extensions
Libmemcaced is divided into two major versions 0.x and 1.x, 1.x version from 2011-09-28 onwards, compiling very troublesome, need gcc4.0 above the specialized configuration, compile extremely slow. 0.x version is much simpler, the highest version is 0.53, so choose Install 0.53

Acura always appear in pairs, PHP memcahed also starting from 2.1.0, request libmemcached must be 1.0.x version

libmemcaced I use 0.53, that php-memcahed choose 2.0.0. Open source software version maintenance is a lousy account.

Install libmemcached

wget https://launchpad.net/libmemcached/1.0/0.53/+download/libmemcached-0.53.tar.gz
Tar Xvfz libmemcached-0.53.tar.gz
CD libmemcached-0.53
./configure--prefix=/opt/libmemcached
Make && make install

Installing PHP Extensions

wget http://pecl.php.net/get/memcached-2.0.0.tgz
Tar zvxf memcached-2.0.0.tgz
CD memcached-2.0.0/
./configure--enable-memcached--with-php-config=/usr/local/php/bin/php-config--with-libmemcached-dir=/opt/ libmemcached/
Make && make install

Make install is memcached.so installed to ${php install dir}/extensions/no-debug-non-zts-20090626/, which varies with PHP versions

The final step, modify PHP.ini, plus extension=memcached.so

It is important to note that libmemcached is not libmemcache, they are two different client libraries, the former is currently active and the latter has not been updated for a long time.

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.