PHP extensions memcached and Memcache installation configuration method: Reprint

Source: Internet
Author: User
Tags zts

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

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.