SOLVED [EA-8302] memcache/memcached extensions for PHP 7.2 and 7.3

Mopar1973Man

Member
Mar 9, 2018
10
0
1
New Meadows, Idaho
cPanel Access Level
Website Owner
I'm looking for updated instructions for installing memcached on EA4 and PHP7.2. So far I keep running into really old posts here dating back to 2011 in some cases. I'm looking for 2018 information. Being I've found the Memcached PECL file supports PHP 7.2 but it just creates a long string of errors in WHM attempting to install.
 
Last edited by a moderator:

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
Hello,

The EA4 experimental repo does not support the use of memcache/memcached with PHP 7.2 at this time. Have you tried the manual installation instructions on this thread? At the bottom of the first post, there's a button you can expand named "Previous Workaround Instructions". While it only extends to PHP 7.1, you can use the same method to install the PECL module PHP 7.2. As I understand, the latest stable build on the Memcached PECL module notes it supports PHP 7.2:

GitHub - php-memcached-dev/php-memcached: memcached extension based on libmemcached library

Thank you.
 

Mopar1973Man

Member
Mar 9, 2018
10
0
1
New Meadows, Idaho
cPanel Access Level
Website Owner
Ok. I finally made it out the other side and got it installed. The old article is barely enough to get it installed and working. Really have to watch the php version numbers in the path. Then you have to make sure to install igbinary. Again the key is watching the versions of software and php version in the path.

It would really be helpful if you had an update on that forum post.
 

massafiri

Member
Apr 8, 2016
10
1
3
Melbourne
cPanel Access Level
Root Administrator
Hey guys,

For anyone else trying to install Memcache on 7.2 I found this guide very helpful.

Tested on my server running CloudLinux, WHM76 and EasyApache4:
grepitout.com/install-memcache-cpanel-server/
 
Last edited by a moderator:
  • Like
Reactions: Del Drago

monkey64

Well-Known Member
Nov 6, 2011
100
4
68
cPanel Access Level
Root Administrator
I recently installed the PHP Memcached extension in PHP 7.2. I also installed igbinary and msgpack (both optional) first by using WHM's PECL Installer, making sure to select "ea-php72" first.

1. Download latest memcached (PHP) from : PECL :: Package :: memcached
2. Untar to suitable destination (I used "/downloads") tar xf memcached-3.1.3.tgz" and navigate to the directory
3. cd memcached-3.1.3
4. phpize
5. Run the following (note the correct path to ea-php72, --enable-memcached-igbinary=yes, --enable-memcached-msgpack=yes and --disable-memcached-sasl)

Code:
./configure --with-php-config=/opt/cpanel/ea-php72/root/usr/bin/php-config --with-libmemcached-dir=no --with-zlib-dir=no --with-system-fastlz=no --enable-memcached-igbinary=yes --enable-memcached-msgpack=yes --enable-memcached-json=no --enable-memcached-protocol=no --enable-memcached-sasl=yes --enable-memcached-session=yes --disable-memcached-sasl
6. Run "make". Should return the message "Libraries have been installed in: /downloads/memcached/memcached-3.1.3/modules"
7. All we need is the "memcached.so" module which is in a subfolder called "modules" and needs to be copied to /opt/cpanel/ea-php72/root/usr/lib64/php/modules.
8. Add these lines to the 7.2 php.ini version using the editor, checking first that they actually do exist!

extension=igbinary.so
extension=msgpack.so
extension=memcached.so

9. Restart Apache and you should be able to see the Memcached extension when you run phpinfo().

Screen Shot 2019-01-03 at 10.22.08.png
 
Last edited:
  • Like
Reactions: cPanelMichael

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
Hello Everyone,

I merged a couple of different threads on this topic here. We tracking the request for the memcache/memcached extensions for PHP 7.2 and PHP 7.3 in EasyApache 4 as part of case EA-8302. I'll update this thread with more information on the status of this case as it becomes available.

Thank you.
 
  • Like
Reactions: fisiculturismo

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
Hello @celiac101

I moved your thread here. We're tracking the request for the memcache/memcached extensions for PHP 7.2 and PHP 7.3 in EasyApache 4 as part of case EA-8302. I don't have a specific time frame to offer at this time, however I'll continue to monitor the case and provide updates here as they become available.

Thank you.
 

Bashed

Well-Known Member
Dec 18, 2013
124
4
18
cPanel Access Level
Root Administrator
Need memcached installed on PHP 7.3 to utilize Cloudflare with Railgun.

These instructions won't work on anything above 7.1: Different ways of installing memcached?

Weird thing is, it says it's installed in SSH but doesn't show up in PHP Info.

[[email protected] ~]# /opt/cpanel/ea-php71/root/usr/bin/php -m | grep memcached
-bash: /opt/cpanel/ea-php71/root/usr/bin/php: No such file or directory
[[email protected] ~]# /opt/cpanel/ea-php72/root/usr/bin/php -m | grep memcached
[[email protected] ~]# /opt/cpanel/ea-php73/root/usr/bin/php -m | grep memcached

[[email protected] ~]# yum -y install memcached
Loaded plugins: fastestmirror, universal-hooks
Loading mirror speeds from cached hostfile
* EA4: 66.23.237.210
* EA4-experimental: 66.23.237.210
* cpanel-addons-production-feed: 66.23.237.210
* cpanel-plugins: 66.23.237.210
* base: mirror.umd.edu
* epel: mirror.layeronline.com
* extras: mirror.es.its.nyu.edu
* remi-safe: mirror.team-cymru.com
* updates: mirror.umd.edu
Package memcached-1.4.15-10.el7_3.1.x86_64 already installed and latest version
Nothing to do
 

Bashed

Well-Known Member
Dec 18, 2013
124
4
18
cPanel Access Level
Root Administrator
Tried this method too:

/opt/cpanel/ea-php73/root/usr/bin/pecl install memcached

checking for libmemcached location... found version 1.0.18, under /usr/local
checking for libmemcached sasl.h requirement... no
checking whether to enable sasl support... yes
configure: error: no, libmemcached built with sasl disabled. Run configure with --disable-memcached-sasl or update libmemcached with sasl support
ERROR: `/root/tmp/pear/memcached/configure --with-php-config=/opt/cpanel/ea-php73/root/usr/bin/php-config --with-libmemcached-dir=no --with-zlib-dir=no --with-system-fastlz=no --enable-memcached-igbinary=no --enable-memcached-msgpack=no --enable-memcached-json=no --enable-memcached-protocol=no --enable-memcached-sasl=yes --enable-memcached-session=yes' failed
 

Bashed

Well-Known Member
Dec 18, 2013
124
4
18
cPanel Access Level
Root Administrator
Also tried this:

[[email protected] ~]# yum install cyrus-sasl-devel
Loaded plugins: fastestmirror, universal-hooks
Loading mirror speeds from cached hostfile
* EA4: 66.23.237.210
* EA4-experimental: 66.23.237.210
* cpanel-addons-production-feed: 66.23.237.210
* cpanel-plugins: 66.23.237.210
* base: mirror.umd.edu
* epel: mirror.layeronline.com
* extras: mirror.es.its.nyu.edu
* remi-safe: mirror.team-cymru.com
* updates: mirror.umd.edu
Package cyrus-sasl-devel-2.1.26-23.el7.x86_64 already installed and latest version
Nothing to do


and this method...


[[email protected] ~]# /opt/cpanel/ea-php73/root/usr/bin/pecl install memcached --disable-memcached-sasl
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
parsePackageName(): invalid package name "--disable-memcached-sasl" in "--disable-memcached-sasl"
invalid package name/package file "--disable-memcached-sasl"
pecl/memcached can optionally use PHP extension "igbinary" (version >= 2.0)
pecl/memcached can optionally use PHP extension "msgpack" (version >= 2.0)
downloading memcached-3.1.3.tgz ...
Starting to download memcached-3.1.3.tgz (82,673 bytes)
....................done: 82,673 bytes
15 source files, building
running: phpize
Configuring for:
PHP Api Version: 20180731
Zend Module Api No: 20180731
Zend Extension Api No: 320180731
libmemcached directory [no] : no --disable-memcached-sasl
zlib directory [no] :
use system fastlz [no] :
enable igbinary serializer [no] :
enable msgpack serializer [no] :
enable json serializer [no] :
enable server protocol [no] :
enable sasl [yes] :
enable sessions [yes] :
 

Bashed

Well-Known Member
Dec 18, 2013
124
4
18
cPanel Access Level
Root Administrator
I just followed the steps and restarted apache. Installed for 7.3 not 7.2, right paths and all and no errors. Still doesn't show up in phpinfo output?