1, install memcached
Yum-y Install memcached
/usr/bin/memcached-b-L 127.0.0.1-p 11211-m 150-u Root
To see if memcached is running:
[root@localhost /]# ps -ef | grep memcached//或[root@localhost /]# pstree -p | grep memcached
If you can see that there is a memcached process, it means that our memcached server has been successfully installed.
2, install libmemached
The installation directory is/usr/local/
wget https://launchpad.net/libmemcached/1.0/1.0.16/+download/libmemcached-1.0.16.tar.gz TAR-ZXVF libmemcached-1.0.16.tar.gz CD libmemcached-1.0.16./configure-prefix=/usr/local/libmemcached-with-memcached make && make Install
3. Download the Memcache expansion pack and install
The installation directory is/usr/local/
git clone git://github.com/php-memcached-dev/php-memcached.gitcd php-memcached/#安装扩展/usr/local/php/bin/phpize./ configure-enable-memcached-with-php-config=/usr/local/php/bin/php-config-with-zlib-dir-with-libmemcached-dir=/ usr/local/libmemcached-prefix=/usr/local/php-memcached--disable-memcached-saslmake-j4make Install
After installation, you will be prompted to expand the directory:/usr/local/php/lib/php/extensions/no-debug-zts-20151012/
Edit php.ini:
Extension=/usr/local/php/lib/php/extensions/no-debug-zts-20151012/memcached.so
Put it in the last row, restart the PHP server (called by the component, restart the next Web service)
Re-view Phpinfo:
Centos7 Installing memcached Extensions