Installing memcached under Linux


Memcached installation steps

1. Set up a good LNMP environment in the computer installation

Memcached installation package
Libmemcached install PHP extension dependency package
PHP memcached PHP extension

2. Install dependency package

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. Open service

cd /usr/local/memcached/bin
./memcached -u www -d
-U specified user, cannot start as root user
-D background operation
See if the service is running
ps -ef | grep memcached
Netstat - LNP | grep memcached port number is 11211 by default

5. Install PHP extension library

Install libmemcached first
    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
Install PHP extension library
    yum install -y unzip
    cd php-memcached-php7
Compiling PHP extension library with phpize
    ls /usr/local/php7/bin
    ./configure --with-php-config=/usr/local/php7/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached/
    make && make install
    Path to expansion package
    [note] the extension library under windows is. DLL, and the extension library under Linux is. So
Add the extension library to the PHP configuration file
vi /etc/php.ini
Add on line 900

Restart PHP FPM
service php-fpm restart

Run phpinfo to check whether there is an extension library

Recommended Today

The way of nonlinear optimization

Mathematical knowledge 1、 Nonlinear functionLinear function is another name of a function of first degree, then nonlinear function means that the function image is not a function of a straight line.Nonlinear functions include exponential function, power function, logarithmic function, polynomial function and so on. 2、 Taylor expansion1. Taylor formula:Taylor’s formula is to add a_ The […]