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