Step 1: verify the present version of memcached as below(e.g. in Xshell):
telnet 22.214.171.124 11211 stats
Note: please replace the 126.96.36.199 with your own host’s ip address
Step 2: visit the www.memcached.org and download the latest stable version(e.g. memcached-1.6.5.tar.gz).
Step 3: upload the downloaded file to the “/root/lnmp1.5/src” (lnmp1.5 for example,)
Step 4: modify the version you want in the file “/root/lnmp1.5/include/version.sh”, such as replace the “Memcached_Ver 1.5.14” with “Memcached_Ver 1.6.5”.
Step 5: delete the following information in the file “/root/lnmp/1.5/memcached.sh” as below:
5.1: find the ” if [ -s /usr/local/memcached/bin/memcached ]; then
echo “Memcached already exists.”
5.2: find the “useradd -s /sbin/nologin nobody” and delete the “fi” after it.
Step 6: carry out the installation as below(e.g. in Xshell ):
cd /root/lnmp1.5/ ./addons.sh install memcached
enter 2 to choose installing the php-memcached and the installation will be finished in a few minutes.
Ok, all steps are done and you can verify your memcached version by step 1 or by visit your phpinfo.php like this article