Say bumpy, in order to install this PHP extension php-memcached, even the operating system has changed, from centos5.5 to the centos6.8!!
centos5.5 in the installation of PHP extension php-memcached dependent library libmemcached (download source, compile and install), has been an error, and later verified that the version of the GCC on CentOS is too low, is 4.1.8, to 4.7, 4.8 to use.
And then want to install through Yum, the results centos5.5, yum install libmemcached No, no this source.
Replaced with centos6.8 after the use of Yum installation: Yum install libmemcached unexpectedly can, overjoyed, thought the installation was successful. Results when installing PHP extension php-memcached,./configure has been unsuccessful, causing the make to fail. Check for an error, or because the dependent library libmecached is not installed properly.
So after a bitter lesson, or decided to use the source code installation.
and finally succeeded.
The operation is as follows:
1. Install Dependent library libmemcached
2, install the extension php-memcached
3, modify the php.ini
Yum Install gcc-c++-y
Yum Install Cyrus-sasl-devel
Download libmemcached Source code
wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
Compiling and installing libmemcached
Tar zxvf libmemcached-1.0.15.tar.gz
CD libmemcached-1.0.15
./configure--with-memcached--ENABLE-SASL
Make
Make install
Ldconfig
Compile and install PHP extension php-memcached, this can be used in PHP to operate memcached
wget http://pecl.php.net/get/memcached-2.2.0.tgz
Unzip into memcached-2.2.0
Then there was no configure.
/usr/local/php/bin/phpize (if there is no phpize because you have installed Php-devel, run yum-y install php-devel)
After this name was executed, with configure, happy
./configure--with-php-config=/usr/local/php/bin/php-config--enable-memcached--DISABLE-MEMCACHED-SASL
./configure--with-php-config=/usr/local/php/bin/php-config--enable-memcached
Make && make install
At this point, there is a memcached.so generated, this is what I finally want
Modify PHP.ini
Cd/usr/local/php/lib
VI php.ini
Added: extension=memcached.so
To restart PHP:
./php-fpm
Look at the Phpinfo:
Transferred from: http://www.cnblogs.com/zmfly/p/6126317.html
Install PHP extension php-memcached under CentOS