Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
litespeed_wiki:lsmcd:install-memcached [2018/02/07 16:10]
Jackson Zhang [Installing Memcached]
litespeed_wiki:lsmcd:install-memcached [2020/06/23 12:55] (current)
Jackson Zhang [For Native LSWS Environment]
Line 1: Line 1:
-======Installing Memcached or LSMCD ====== +======Installing Memcached or LSMCD and PHP Memcached Extention ​====== 
-To use object cache, you can install [[https://​memcached.org/​|Memcached]],​ or LiteSpeed'​s version of Memcached, LSMCD. ​+To use object cache, you can install [[https://​memcached.org/​|Memcached]],​ or LiteSpeed'​s version of Memcached, LSMCD.  To work with Memcached or LSMCD memory cache daemon, you will also need to enable [[https://​pecl.php.net/​package/​memcached|the php memcached extention]]. ​ This wiki will explain how to install/​verify Memcached or LSMCD daemon, and also how to install/​verify PHP PECL Memcached extention for your environment
  
-=====Install ​LiteSpeed ​Memcached=====+===== Install ​Memory Cache Daemon ​Memcached ​or LSMCD ===== 
 + 
 +==== Install LiteSpeed Memcached ​====
  
 LSMCD is a high-performance,​ distributed caching system with file-backed shared memory. It's generic in nature, but was originally intended for use in speeding up dynamic web applications by alleviating database load. It is designed as a drop-in replacement for Memcached, however we also have a few features that Memcached does not: High Availability and persistence of data. High Availability means that if one or more of your servers goes down, your data can still be accessed and updated as though it was still up. Persistence of data means that there is no need for a database backend. Whatever you put in LSMCD stays in LSMCD unless you say otherwise. LSMCD is a high-performance,​ distributed caching system with file-backed shared memory. It's generic in nature, but was originally intended for use in speeding up dynamic web applications by alleviating database load. It is designed as a drop-in replacement for Memcached, however we also have a few features that Memcached does not: High Availability and persistence of data. High Availability means that if one or more of your servers goes down, your data can still be accessed and updated as though it was still up. Persistence of data means that there is no need for a database backend. Whatever you put in LSMCD stays in LSMCD unless you say otherwise.
Line 9: Line 11:
  
  
-=====Install Memcached=====+====Install Memcached====
  
-====for Centos7====+===for Centos7===
  
 <​code>​yum install memcached -y <​code>​yum install memcached -y
Line 19: Line 21:
 systemctl enable memcached</​code>​ systemctl enable memcached</​code>​
  
 +=== For Ubuntu/​Debian ===
 +<​code>​apt-get install memcached
  
-===Verify===+systemctl start memcached 
 + 
 +systemctl enable memcached</​code>​ 
 +==== Verify ​Memcached or LSMCD Daemon ====
  
 <​code>​telnet 127.0.0.1 11211 <​code>​telnet 127.0.0.1 11211
Line 26: Line 33:
 stats</​code>​ stats</​code>​
  
-=====Install PHP extension memcached=====+=====Install PHP Extension Memcached=====
  
 ====For Plesk Centos7:​==== ====For Plesk Centos7:​====
Line 47: Line 54:
  
 plesk bin php_handler --reread</​code>​ plesk bin php_handler --reread</​code>​
 +
 +And then graceful restart LSWS and restart detached lsphp by ''​killall lsphp''​ or ''​pkill lsphp''​.
  
  
Line 59: Line 68:
 plesk bin php_handler --reread</​code>​ plesk bin php_handler --reread</​code>​
  
 +And then graceful restart LSWS.
  
 ====For Native LSWS Environment==== ====For Native LSWS Environment====
 +PHP memcached packages are pecl packages and named ''​lsphpxx-pecl-memcached''​ for CentOSs or ''​lsphpxx-memcached''​ for Debian and Ubuntu in LiteSpeed Repo. 
  
-<​code>​yum install lsphp56-pecl-memcached lsphp70-pecl-memcached lsphp71-pecl-memcached lsphp72-pecl-memcached</​code>​+For Centos: 
 +<​code>​yum install lsphp56-pecl-memcached lsphp70-pecl-memcached lsphp71-pecl-memcached lsphp72-pecl-memcached lsphp73-pecl-memcached lsphp74-pecl-memcached</​code>​
  
 +For Debian and Ubuntu:
 +<​code>​apt-get install lsphp70-memcached lsphp71-memcached lsphp72-memcached lsphp73-memcached lsphp74-memcached</​code>​
 +
 +And then graceful restart LSWS and restart detached lsphp by ''​killall lsphp''​ or ''​pkill lsphp''​.
  
 ====For cPanel:==== ====For cPanel:====
  
 +===Centos===
 ===PHP7.0/​7.1/​7.2=== ===PHP7.0/​7.1/​7.2===
  
Line 73: Line 90:
 /​opt/​cpanel/​ea-php70/​root/​usr/​bin/​pecl install memcached /​opt/​cpanel/​ea-php70/​root/​usr/​bin/​pecl install memcached
 /​opt/​cpanel/​ea-php71/​root/​usr/​bin/​pecl install memcached /​opt/​cpanel/​ea-php71/​root/​usr/​bin/​pecl install memcached
-/​opt/​cpanel/​ea-php72/​root/​usr/​bin/​pecl install memcached</​code>​+/​opt/​cpanel/​ea-php72/​root/​usr/​bin/​pecl install memcached
  
 +echo "​extension=memcached.so"​ > /​opt/​cpanel/​ea-php70/​root/​etc/​php.d/​20-memcached.ini
 +echo "​extension=memcached.so"​ > /​opt/​cpanel/​ea-php71/​root/​etc/​php.d/​20-memcached.ini
 +echo "​extension=memcached.so"​ > /​opt/​cpanel/​ea-php72/​root/​etc/​php.d/​20-memcached.ini
 +</​code>​
 +
 +And then graceful restart LSWS and restart detached lsphp by ''​killall lsphp''​ or ''​pkill lsphp''​.
  
 ===PHP5.6=== ===PHP5.6===
Line 80: Line 103:
 <​code>​yum install -y libmemcached-devel <​code>​yum install -y libmemcached-devel
  
-/​opt/​cpanel/​ea-php56/​root/​usr/​bin/​pecl install memcached-2.2.0</​code>​+/​opt/​cpanel/​ea-php56/​root/​usr/​bin/​pecl install memcached-2.2.0 
 + 
 +echo "​extension=memcached.so"​ > /​opt/​cpanel/​ea-php56/​root/​etc/​php.d/​20-memcached.ini 
 +</​code>​
  
 +And then graceful restart LSWS and restart detached lsphp by ''​killall lsphp''​ or ''​pkill lsphp''​.
  
 ===Troubleshooting:​=== ===Troubleshooting:​===
Line 111: Line 138:
 make install make install
 echo "​memcached.so"​ > /​opt/​cpanel/​ea-php71/​root/​etc/​php.ini</​code>​ echo "​memcached.so"​ > /​opt/​cpanel/​ea-php71/​root/​etc/​php.ini</​code>​
 +
 +And then graceful restart LSWS and restart detached lsphp by ''​killall lsphp''​ or ''​pkill lsphp''​.
  
 If you have further issues installing the extension on cPanel, please contact [[https://​cpanel.com/​support/​|cPanel support]]. If you have further issues installing the extension on cPanel, please contact [[https://​cpanel.com/​support/​|cPanel support]].
 +
 +===CloudLinux===
 +
 +<​code>​yum install ea-phpXX-php-memcached</​code>​
 +
 +Change ''​XX''​ to PHP version number , as php70, php71...etc
 +====Direct Admin====
 +
 +===PHP7.0/​7.1/​7.2===
 +
 +<​code>​yum install -y libmemcached-devel
 +
 +/​usr/​local/​php70/​bin/​pecl install memcached
 +/​usr/​local/​php71/​bin/​pecl install memcached
 +/​usr/​local/​php72/​bin/​pecl install memcached
 +
 +echo "​extension=memcached.so"​ > /​usr/​local/​php70/​lib/​php.conf.d/​20-memcached.ini
 +echo "​extension=memcached.so"​ > /​usr/​local/​php71/​lib/​php.conf.d/​20-memcached.ini
 +echo "​extension=memcached.so"​ > /​usr/​local/​php72/​lib/​php.conf.d/​20-memcached.ini
 +</​code>​
 +
 +And then graceful restart LSWS and restart detached lsphp by ''​killall lsphp''​ or ''​pkill lsphp''​.
 +
 +===PHP5.6===
 +
 +<​code>​yum install -y libmemcached-devel
 +
 +/​usr/​local/​php70/​bin/​pecl install memcached-2.2.0
 +
 +echo "​extension=memcached.so"​ > /​usr/​local/​php56/​lib/​php.conf.d/​20-memcached.ini
 +</​code>​
 +
 +And then graceful restart LSWS and restart detached lsphp by ''​killall lsphp''​ or ''​pkill lsphp''​.
 +
 ==== Verify PHP memcached extension ==== ==== Verify PHP memcached extension ====
  
  • Admin
  • Last modified: 2018/02/07 16:10
  • by Jackson Zhang