1.libevent
Source address: https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
1) ./configure --prefix=/usr --disable-static
2) make && make install
2.memcached
Source address: http://www.memcached.org/files/memcached-1.4.24.tar.gz
1) ./configure --prefix=/usr/local/memcached-1.4.24/ --with-libevent=/usr
2) make && make install
3. Start memcahed
/usr/local/memcached-1.4.24/bin/memcached -d -u root -l 127.0.0.1 -p 11211 -m 100 -P /var/run/memcached_11211.pid
-d: run in daemon mode
-m: allocate memory
-P: pid file save location
4. Terminate memcahed
kill cat memcached_11211.pid
5.libmemcached
Source address: https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
1) ./configure --prefix=/usr/local/libmemcached-1.0.18
2) make && make install
6. Install the php-memcached extension under the php7 version
1) get clone https://github.com/php-memcached-dev/php-memcached -b php7 php-memcached
2) tar zxvf php-memcached
3) cd php-memcached
4) phpize
5) ./configure --enable-memcached --with-php-config=/usr/local/php/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached-1.0.18 --disable-memcached-sasl
6) make && make install
After the installation is successful, vim php.ini, add extension=memcached.so, restart php-fpm.