CentOS 6.6 Install PHP Memcached extension

Source: Internet
Author: User
Tags php memcached zts

PHP's Memcached extension uses the API provided by the Libmemcached library to interact with the Memcached server. It also provides a session processor (memcached).

PHP Memcached Extension Support Getmulti,setmulti methods, and Memcache extension is not supported;

When installing the Memcached extension, you need to install the libmemcached,libmemcached is Memcached C client, it has the advantage of low memory, line Cheng characteristics, in high concurrency, stability decisively improved.

First install libmemcached 1.0.18

Enter/USR/LOCAL/SRC, download the source package:

[Email protected] src]# wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz

  

Extract:

[Email protected] src]# TAR-ZXVF libmemcached-1.0.18.tar.gz

  

Enter the unpacked folder:

[Email protected] libmemcached-1.0.18]# CD libmemcached-1.0.18

 

Configuration:

[Email protected] libmemcached-1.0.18]#/configure--prefix=/usr/local/libmemcached--with-memcached

  

Compile and install:

[[email protected] libmemcached-1.0.18]# make && make install

  

Installation of PHP Memcached 2.2.0 extensions

Go to/USR/LCOAL/SRC and download the extended source package:

[Email protected] src]# wget https://launchpad.net/libmemcached/+download/memcached-2.2.0.tgz

  

Extract:

  

Enter the extracted directory:

[Email protected] src]# CD memcached-2.2.0

  

Add extensions dynamically to PHP with Phpize:

[Email protected] memcached-2.2.0]#/usr/local/php/bin/phpize

  

Configuration:

[Email protected] memcached-2.2.0]#./configure  --with-memcached-with-php-config=/usr/local/php/bin/ Php-config--with-libmemcached-dir=/usr/local/libmemcached--enable-memcached

If error:

Configure:error:no, Sasl.h is not available. Run Configure with--DISABLE-MEMCACHED-SASL to disable this check

Then the configuration should read:

[Email protected] memcached-2.2.0]#/configure  --with-memcached-with-php-config=/usr/local/php/bin/ Php-config--with-libmemcached-dir=/usr/local/libmemcached--enable-memcached--DISABLE-MEMCACHED-SASL

  

Compile and install:

[[email protected] memcached-2.2.0]# make && make install

Installation Complete:

  

A memcached.so file is generated:

/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/

Open a. php.ini file and add a "extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/memcached.so"

Restart LNMP.

Visit Phpinfo:

Reference:

Installation of PHP memcached extensions

Linux-based libmemcached,php extended memcached installation

CentOS 6.6 Install PHP Memcached extension

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.