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.