What are the current instructions for installing memcached?

inspiredearth

Member
Dec 1, 2015
19
2
3
New Zealand
cPanel Access Level
Reseller Owner
I've been attempting to get Memcached working. The server has Centos6.9, with WHM/CPanel. Using PHP 7.0.

I did the EasyApache side of things, but I gather that leaves out the PHP side.

All the threads I've found on this subject, with instructions, are from 2010, a few from 2013. I suspect those instructions are no longer applicable (2018), especially since some commands involve installing specified versions of packages, which have surely been updated in the last 8 years.

Are there any current instructions for implementing Memcached on a WHM/Cpanel server?
 

inspiredearth

Member
Dec 1, 2015
19
2
3
New Zealand
cPanel Access Level
Reseller Owner
Thanks. Unfortunately that only mentioned the Apache side of things, which is what I already did through EA4. Memcache/d does not show up in PHP though, meaning in php-info there is no mention of memcached.

What's the secret?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,270
463
Hello,

Can you verify the specific commands you used? The installation commands provided for the EA4 experimental RPMS include the PHP extensions:

Code:
yum install ea4-experimental
yum install ea-php##-php-memcache
yum install ea-php##-php-memcached
Thank you.
 

inspiredearth

Member
Dec 1, 2015
19
2
3
New Zealand
cPanel Access Level
Reseller Owner
Hello,
Can you verify the specific commands you used? The installation commands provided for the EA4 experimental RPMS include the PHP extensions:

Code:
yum install ea4-experimental
yum install ea-php##-php-memcache
yum install ea-php##-php-memcached
I get the following error when trying to install those two ea-php packages...

Code:
Error: Package: ea-php71-php-memcached-3.0.2-1.1.128.cpanel.x86_64 (EA4-experimental)
           Requires: libmemcached.so.11()(64bit)
Error: Package: ea-php71-php-memcached-3.0.2-1.1.128.cpanel.x86_64 (EA4-experimental)
           Requires: libmemcachedutil.so.2()(64bit)
I did a yum install libmemcached and that has installed. Although I see it installed libmemcached-0.31-1.1.el6.x86_64 which I gather is different from libmemcached.so.11 because trying to install ea-php71-php-memcached continues to give the above dependency error in full.

In answer to your question... the commands I'd used previously were:

Code:
yum -y update
yum install -y libevent libevent-devel
yum install -y memcached
yum install -y php-pecl-memcache
Which was based on instructions here gist.github.com/irazasyed/6066507 and here devdocs.magento.com/guides/v2.0/config-guide/memcache/memcache_centos.html

P.S. Is there a way to markup inline code on this forum?
 
Last edited by a moderator:

24x7server

Well-Known Member
Apr 17, 2013
1,912
99
78
India
cPanel Access Level
Root Administrator
Twitter
Hi,

Thanks. Unfortunately that only mentioned the Apache side of things, which is what I already did through EA4. Memcache/d does not show up in PHP though, meaning in php-info there is no mention of memcached.
PHP modules are different. You can use pecl command to install the memcache.
# pecl install memcache

OR

The other way it download the memcache source files and compile it with individual EA-PHP..
# wget http://pecl.php.net/get/memcache
# cd memcache-3.0.8
# phpize
# make
# make all

Add memcache extension in respective ea-php individual php.ini file.

Make sure you use appropriate phpize as per your EA-PHP built location and binaries..
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,270
463
Error: Package: ea-php71-php-memcached-3.0.2-1.1.128.cpanel.x86_64 (EA4-experimental) Requires: libmemcached.so.11()(64bit) Error: Package: ea-php71-php-memcached-3.0.2-1.1.128.cpanel.x86_64 (EA4-experimental) Requires: libmemcachedutil.so.2()(64bit)
Hello,

Feel free to open a support ticket if you'd like us to take a closer look at that error message, as I've not been able to reproduce that on a test environment.

Thank you.