Memcached installation steps

1. Set up the LNMP environment for installation in the computer

The LibMemcached installation PHP extension depends on the package PHP - the Memcached PHP extension

2. Install dependency packages

yum install -y libevent libevent-devel

3. Install memcached

Tar-zxvf memcached-1.4.33.tar.gz CD memcached-1.4.33. /configure --prefix=/usr/local/memcached make && make install

4. Start the service

CD /usr/local/memcached/bin./ memcached-u www-d-u Does not start as root - d if the background check service run ps - ef | grep memcached netstat LNP | grep memcached port number is 11211 by default

5. Install the PHP extension library

Libmemcached tar-zxvf libmemcached-1.0.18.tar.gz CD libmemcached-1.0.18. /configure --prefix=/usr/local/libmemcached --with-memcached=/usr/local/memcached/ make && make install yum install -y unzip unzip php-memcached-php7.zip CD PHP - memcached - php7 phpize to compile PHP extensions library ls/usr/local/php7 / bin/usr/local/php7 / bin/phpize. / configure --with-php-config=/usr/local/php7/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached/ make && make install The path of the expansion pack/usr/local/php7 / lib/PHP/extensions/no - debug - non - ZTS - 20151012 / memcached. So [note] Windows extension libraries as below. DLL, Add the extension library to the PHP configuration file vi /etc/php.ini on line 900 The extension = / usr/local/php7 / lib/PHP/extensions/no - debug - non - ZTS - 20151012 / memcached. So restart PHP - FPM service PHP - FPM restart Run the code phpinfo to see if there is an extension library