This article reproduced: http://www.jb51.net/article/56999.htm
PHP connection memcached Cache Server client has two, one is Memcache is a relatively low-level development library, Memcached is a relatively new development library, PHP installation of either of these two extensions can be used in writing PHP code memcached cache data, to cache the results of PHP execution
1, installation Memcache
TAR-ZXVF memcache-2.2.7.tgz
CD memcache-2.2.7
/usr/local/php/bin/phpize
./configure–with-php-config=/usr/local/php/bin/php-config
Make && make install
After successful installation, there will be the following similar prompt
Installing Shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/
Memcache.so is generated under the/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/directory
Edit PHP.ini Add the following
Extension =/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/memcache.so
Restart PHP-FPM
To see if the Memcache module has been loaded
2, installation memcached
Since Memcached was developed based on libmemcached, install libmemcached first
Install libmemcached to install GCC44 gcc44-c++
Yum Install gcc*
Export cc= "GCC44"
Export cxx= "g++44"
TAR-ZXVF libmemcached-1.0.18.tar.gz
CD libmemcached-1.0.18
./configure–prefix=/usr/local/libmemcached
Make && make install
TAR-ZXVF memcached-2.2.0.tgz
CD memcached-2.2.0
/usr/local/php/bin
./configure–with-php-config=/usr/local/php/bin/php-config \
–with-libmemcached-dir=/usr/local/libmemcached/
Make && make install
After the installation is complete, there are similar memcache tips
The memcached.so will appear under the/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525 path
Edit PHP.ini Add the following
Extension =/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/memcached
Restart PHP-FPM See if PHP supports memcached
PHP extensions memcached and Memcache installation configuration method: Reprint