Installing Memcached
- Obtain the Memcached source code.
- Download the Memcached source code package using the local browser.
Download address: https://github.com/memcached/memcached/archive/1.5.12.zip
- Copy the source code to the /home directory on the server.
If the server is connected to the Internet, you can run the wget command on the server to download the source code.
1 2
cd /home wget https://github.com/memcached/memcached/archive/1.5.12.zip --no-check-certificate
- Download the Memcached source code package using the local browser.
- Decompress the source code package.
1 2
cd /home unzip 1.5.12.zip
- Switch to the memcached-1.5.12 directory.
1cd memcached-1.5.12
- Configure Memcached.
sh autogen.sh ./configure --prefix=/opt/memcached
--prefix indicates the Memcached installation directory, for example, /opt/memcached in this step.
- Perform the compilation and installation.
1make -j60 && make install
-j60 leverages multi-core CPUs to speed up the compilation.
- View the installation directory.
1 2
ls /opt/memcached ls /opt/memcached/bin/

- Configure environment variables.
- Edit the /etc/profile file.
vim /etc/profile
- Add the following command to the file:
1echo export PATH=$PATH:/opt/memcached/bin/ >> /etc/profile
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Make the environment variables take effect.
1source /etc/profile
- Edit the /etc/profile file.
Parent topic: Memcached Porting Guide