PHP extensions memcached and memcache installation configuration method _linux

Source: Internet
Author: User

PHP connection memcached Cache server has two clients, one is memcache is the bottom of the development library, Memcached is a relatively new development library, PHP Install any one of these two extensions can be used in the writing of PHP code memcached cache data, to achieve the cache PHP execution results

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 the installation is successful, there are similar prompts
Installing Shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/
In/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/this directory generates memcache.so
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 is developed based on libmemcached, it is first installed libmemcached

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
There are hints similar to memcache after the installation is complete
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
Reboot php-fpm to see if PHP supports memcached

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.