Home > Article > Operation and Maintenance > How to install Memcached service method in Linux
This article mainly shares with you how to install the Memcached service method in Linux. The installation of Memcached is based on the libevent environment, so when we install memcached, we first install the libevent environment.
Install libevent environment. The version 2.0.21 is used here.
Upload rz to the linux service, use
tar -zxvf libevent-2.0.21-stable.tar.gz
After decompression, rename to
mv libevent-2.0.21-stable.tar.gz libevent
Enter libevent
cd libevent
Configure the environment: At this time, the environment is placed under the libevent path under usr.
./configure -prefix=/usr/libevent
Execute
make && make install command
Environment configuration successful
Upload Rz to the linux server and decompress it
tar -zxvf memcached-1.5.6.tar.gz
Rename:
mv memcached-1.5.6.tar.gz memcached
cd Enter the decompressed memcached directory:
Execute the configuration command, also configure memcached under usr, the directory will not be automatically created.
Note that when creating a new one, the newly installed libevent environment will be used, so = is followed by the environment path
./configure --prefix=/usr/memcache/ --with-libevent=/usr/libevent
After configuring no error, execute
make
After no error is reported, execute
make install
The installation is successful.
ps –ef | grep memcached. Check the port number, not open.
Enable memcached.
Start memcached in daemon mode
/usr/memcache/bin/memcached-d -l 127.0.0.1 -p 11211 -m 2048 -u root
Check ps again –ef| grep memcached.
There is a process in use..
telnet test
telnet 127.0.0.1 11211, successful
Related recommendations:
Implementation steps of using memcached and xcache for PHP cache optimization
Ubuntu memcached installation and configuration method in php
Instance introduction of high-performance caching system (Memcached)
The above is the detailed content of How to install Memcached service method in Linux. For more information, please follow other related articles on the PHP Chinese website!