PHP builds a memcached module that uses igbinary as a serialization component

Source: Internet
Author: User
Tags memcached serialization

Whether you are installing from PECL or installing from the Apt-get command, the memcached modules on the installation are supported without the Igbinary serialization component, and because Igbinary has great performance advantages, try to use Igbinary As the serialization component of the memcached.

Environment description

Operating system: Ubuntu Server 14.04 64-bit
php:php 5.5.9

Build process

First, install the PHP development version

yuanyu@usvr:~$ sudo apt-get install Php5-dev

then install the dependent libraries

yuanyu@usvr:~$ sudo apt-get install Libevent-dev
yuanyu@usvr:~$ sudo apt-get install Pkg-config

Next, install the Igbinary module

yuanyu@usvr:~$ sudo pecl install igbinary

build libmemcached from source code

Get libmemcached's source code, here is the 1.0.18 version

yuanyu@usvr:~$ CD tmp
yuanyu@usvr:~/tmp$ wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz

Unzip, configure, and build

yuanyu@usvr:~/tmp$ Tar xzvf libmemcached-1.0.18.tar.gz
yuanyu@usvr:~/tmp$ CD libmemcached-1.0.18
yuanyu@usvr:~/tmp/libmemcached-1.0.18$./configure
yuanyu@usvr:~/tmp/libmemcached-1.0.18$ make
yuanyu@usvr:~/tmp/libmemcached-1.0.18$ sudo make install

Build php5-memcached from source code

Use PECL to get php5-memcached's source code, and then enable--enable-memcached-igbinary when configured.

yuanyu@usvr:~/tmp$ pecl Download memcached-2.2.0
yuanyu@usvr:~/tmp$ Tar xzvf memcached-2.2.0.tgz
yuanyu@usvr:~/tmp$ CD memcached-2.2.0
yuanyu@usvr:~/tmp/memcached-2.2.0$ phpize
yuanyu@usvr:~/tmp/memcached-2.2.0$./configure--enable-memcached-igbinary--DISABLE-MEMCACHED-SASL
yuanyu@usvr:~/tmp/memcached-2.2.0$ make
yuanyu@usvr:~/tmp/memcached-2.2.0$ sudo make install

Configure PHP to join the newly built two modules

Upon completion of the build step above, you will generate 2 so files in the PHP Extension module: igbinary.so and memcached.so, and configure the two files into your operating environment.

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.