Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision Next revision Both sides next revision | ||
install_memcached [2018/01/23 21:22] qtwrk created |
install_memcached [2018/02/01 14:09] Lisa Clarke [For cPanel:] |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ======Installing Memcached====== | ||
+ | You can install Memcached, or LiteSpeed's version of Memcached, LSMCD. | ||
+ | |||
=====Install LiteSpeed Memcached===== | =====Install LiteSpeed Memcached===== | ||
- | LSMCD is a high-performance, distributed caching system with file-backed shared memory, generic in nature, but 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 go 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. |
- | installation guide please visit this wiki [[litespeed_wiki:lsmcd|here]] | + | To install LiteSpeed Memcached, please see [[litespeed_wiki:lsmcd:installation|Compiling/Installing LSMCD]]. |
- | =====Install Mecached===== | + | =====Install Memcached===== |
====for Centos7==== | ====for Centos7==== | ||
- | |||
<code>yum install memcached -y | <code>yum install memcached -y | ||
Line 23: | Line 25: | ||
stats</code> | stats</code> | ||
- | |||
- | |||
=====Install PHP extension memcached===== | =====Install PHP extension memcached===== | ||
- | ====for Plesk Centos7:==== | + | ====For Plesk Centos7:==== |
===PHP7.0/7.1/7.2=== | ===PHP7.0/7.1/7.2=== | ||
Line 60: | Line 60: | ||
- | ===for native LSWS environment=== | + | ====For Native LSWS Environment==== |
<code>yum install lsphp56-pecl-memcached lsphp70-pecl-memcached lsphp71-pecl-memcached lsphp72-pecl-memcached</code> | <code>yum install lsphp56-pecl-memcached lsphp70-pecl-memcached lsphp71-pecl-memcached lsphp72-pecl-memcached</code> | ||
- | =====verify:===== | + | ====For cPanel:==== |
+ | |||
+ | ===PHP7.0/7.1/7.2=== | ||
+ | |||
+ | <code>yum install -y libmemcached-devel | ||
+ | |||
+ | /opt/cpanel/ea-php70/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> | ||
+ | |||
+ | |||
+ | ===PHP5.6=== | ||
+ | |||
+ | <code>yum install -y libmemcached-devel | ||
+ | |||
+ | /opt/cpanel/ea-php56/root/usr/bin/pecl install memcached-2.2.0</code> | ||
+ | |||
+ | |||
+ | ===Troubleshooting:=== | ||
+ | |||
+ | If installation returns error messages: | ||
+ | |||
+ | <code>checking for libmemcached location... configure: error: memcached support requires libmemcached. Use --with-libmemcached-dir=<DIR> to specify the prefix where libmemcached headers and library are located | ||
+ | ERROR: `/root/tmp/pear/memcached/configure --with-php-config=/opt/cpanel/ea-php71/root/usr/bin/php-config --with-libmemcached-dir=no' failed</code> | ||
+ | |||
+ | Please install libmemcached and the memcached extension by compiling from source code (replace php71 with your php version): | ||
+ | |||
+ | <code>wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz | ||
+ | tar zxvf libmemcached-1.0.18.tar.gz | ||
+ | cd libmemcached-1.0.18 | ||
+ | ./configure --prefix=/usr/local/libmemcached | ||
+ | # if above failed with error related to SASL , please run "yum install cyrus-sasl*" and run: (without #) | ||
+ | # ./configure --prefix=/usr/local/libmemcached --enable-sasl | ||
+ | make | ||
+ | make install | ||
+ | |||
+ | wget http://pecl.php.net/get/memcached-3.0.4.tgz | ||
+ | tar zxvf memcached-3.0.4.tgz | ||
+ | cd memcached-3.0.4 | ||
+ | /opt/cpanel/ea-php71/root/usr/bin/phpize | ||
+ | ./configure --with-php-config=/opt/cpanel/ea-php71/root/usr/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached --disable-memcached-sasl | ||
+ | # if above failed with error related to SASL , please run "yum install cyrus-sasl*" and run: (without #) | ||
+ | # ./configure --with-php-config=/opt/cpanel/ea-php71/root/usr/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached --enable-memcached-sasl | ||
+ | make | ||
+ | make install | ||
+ | echo "memcached.so" > /opt/cpanel/ea-php71/root/etc/php.ini</code> | ||
+ | |||
+ | If you have further issues installing the extension on cPanel, please contact [[https://cpanel.com/support/|cPanel support]]. | ||
+ | =====Verify:===== | ||
- | create a php file in vhost directory, and access it. | + | Create a php file in vhost directory, and access it. |
<code><?php | <code><?php | ||
Line 74: | Line 122: | ||
?></code> | ?></code> | ||
- | memcached should be shown: | + | Memcached should be shown: |
{{ :litespeed_wiki:cache:lscwp:configuration:cache:object_cache:php-memd.jpg?direct |}} | {{ :litespeed_wiki:cache:lscwp:configuration:cache:object_cache:php-memd.jpg?direct |}} | ||