PHP installation memcached Extended notes

Source: Internet
Author: User
Tags ini json memcached zts

This article mainly introduces the PHP installation memcached extended notes, this article explains the installation of the service side, Launchpad, installation memcached extension and configure php.ini, and other content, need friends can refer to the

Recently in the server upper cache system, log the PHP installation memcached extension.

The code is as follows:

# Installation Service Side

Yum Install Memcached-y

I. Launchpad

Please download the latest version of Libmemcached (20150524) at Https://launchpad.net/libmemcached/+download.

The code is as follows:

Cd/tmp

wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz

Tar zxf libmemcached-1.0.18.tar.gz

CD libmemcached-1.0.18

./configure

Make

Make install

Ii. Installation of memcached extensions

Locate and install the memcached extensions for PHP in Pecl (the PHP Extension Community Library).

The code is as follows:

In pecl you can find the following two easy to confuse memcache PHP extensions, can you distinguish between them? Do you know why we use the former? Please readers purple star Google!

memcached PHP extension for interfacing with memcached via Libmemcached Library

Memcache memcached Extension

[Https://pecl.php.net/package/memcached] [4] The latest version is 2.2.0

The code is as follows:

Mkdir/usr/src/php-p

cd/usr/src/php

wget Https://pecl.php.net/get/memcached-O memcached-2.2.0.tgz

Tar XF memcached-2.2.0.tgz

CD memcached-2.2.0

Phpize

# We have added some new features in the configuration to support JSON and igbinary, so we can study it sometime.

./configure--enable-memcached--enable-memcached-json--enable-memcached-igbinary

Make

Make install

# Notice the final output

# Installing shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/

Here we move it to the extension directory of PHP

The code is as follows:

cp/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/*.so/usr/local/php/lib/php/extensions/

Iii. Configuring PHP.ini

Open the php.ini file that is in effect

The code is as follows:

Vim/usr/local/php/etc/php.ini

# Add the following configuration

[Memcached]

Extension=memcached.so

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.