Recommended way to install redis on WHM (CentOS 7)

greektranslator

Well-Known Member
Jun 5, 2011
124
10
68
Greece
cPanel Access Level
Root Administrator
What is the recommended way to install redis? Is it

yum install php-pecl-redis as I can see here: phpredis/phpredis
[I can also see a pecl-redis package at WHM > Software > Module Installers > PHP PECL > redis search > redis (5.2.2) ]

Or something like this as I can see here: How To Install Redis on cPanel - TecAdmin

yum install epel-release
yum install redis
systemctl enable redis
systemctl start redis
/opt/cpanel/ea-php72/root/usr/bin/pecl install igbinary igbinary-devel redis (to enable for php 7.2 for example)
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,309
363
Houston

speckados

Well-Known Member
Its not correct because I think the best way (and correct) is put epel.repo in mode and install with option --enablerepo=epel
If epel is enable and yum is not properly configured, some time system can broke with epel packages.

Is my experience after 15 years with WHMC/cPanel
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
17,470
2,843
363
cPanel Access Level
Root Administrator
Thanks for those details. That article isn't something under cPanel's control so I don't have a way to get that updated on my end. You may want to reach out to the creator of that site to see if they are willing to make changes.
 

bonny3

Active Member
Apr 11, 2018
30
4
8
italy
cPanel Access Level
Root Administrator
What is the recommended way to install redis? Is it

yum install php-pecl-redis as I can see here: phpredis/phpredis
[I can also see a pecl-redis package at WHM > Software > Module Installers > PHP PECL > redis search > redis (5.2.2) ]

Or something like this as I can see here: How To Install Redis on cPanel - TecAdmin

yum install epel-release
yum install redis
systemctl enable redis
systemctl start redis
/opt/cpanel/ea-php72/root/usr/bin/pecl install igbinary igbinary-devel redis (to enable for php 7.2 for example)
Hi,

I installed this on php 7.2
/opt/cpanel/ea-php72/root/usr/bin/pecl install igbinary igbinary-devel redis
could you tell me how I can uninstall this?

Thanks
 

bonny3

Active Member
Apr 11, 2018
30
4
8
italy
cPanel Access Level
Root Administrator
@bonny3 - instead of "install" you can use the "uninstall" command to remove those.
Ok it works,
Thanks! :)
I would like to know when I install if these values should be set to (no) or should (yes)

enable igbinary serializer support? [no] :
enable lzf compression support? [no] :
enable zstd compression support? [no] :
 

Attachments

c4consulting

Registered
Sep 24, 2021
1
0
1
Melbourne
cPanel Access Level
DataCenter Provider
Just adding this for anyone else who is looking to set this up. I've also added the instructions to install the cpanel plugin for redis as well. Login and run in terminal or via SSH


for CentOS 6/RHEL 6

rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum -y install redis --enablerepo=remi --disableplugin=priorities
chkconfig redis on
service redis start
for CentOS 7/RHEL 7

rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
yum -y install redis --enablerepo=remi --disableplugin=priorities
systemctl enable redis
systemctl start redis

Installing the Redis PHP extension for all available versions of PHP.
Copy and paste the entire block into SSH, don't do line by line.

for phpver in $(whmapi1 php_get_installed_versions|grep -oE '\bea-php.*') ; do
cd ~
wget -O redis.tgz https://pecl.php.net/get/redis
tar -xvf redis.tgz
cd ~/redis* || exit
/opt/cpanel/"$phpver"/root/usr/bin/phpize
./configure --with-php-config=/opt/cpanel/"$phpver"/root/usr/bin/php-config
make clean && make install
echo 'extension=redis.so' > /opt/cpanel/"$phpver"/root/etc/php.d/redis.ini
rm -rf ~/redis*
done

/scripts/restartsrv_httpd
/scripts/restartsrv_apache_php_fpm

INSTALL CPANEL PLUGIN


git clone GitHub - cruzehost/redis_cpanel: Redis management plugin for cPanel


As root, do the following:
cd /path/to/plugin
chmod +x install.sh
./install.sh
 

WebSavvyGuy

Active Member
May 10, 2018
31
4
58
China
cPanel Access Level
Root Administrator
yum install epel-release
yum install redis
systemctl enable redis
systemctl start redis
/opt/cpanel/ea-php72/root/usr/bin/pecl install igbinary igbinary-devel redis (to enable for php 7.2 for example)

Are these still the proper commands to run to install Redis on Cpanel? If I use another version of PHP i just change the "ea-php72" to "ea-phpxx", right?

Thanks
 

sahostking

Well-Known Member
May 15, 2012
403
29
78
Cape Town, South Africa
cPanel Access Level
Root Administrator
Twitter
Also we experienced issues with Redis, as memory mapping in redis itself shares it between each site. So when we had it enabled customers would get at times other sites content. Hence we removed it immediately.

This was years ago though. Other panels has better integration of Redis where they seperate it like litespeed does with "IDs". However then again with memcached I think is better for cpanel.
 

sibony88

Member
Mar 29, 2020
5
0
1
israel
cPanel Access Level
Root Administrator
Any good posts on how to get this done on Almalinux 8 ?
i just changed the repo to 8, worked fine to me
rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-8.rpm
yum -y install redis --enablerepo=remi --disableplugin=priorities
systemctl enable redis
systemctl start redis

Installing the Redis PHP extension for all available versions of PHP.
Copy and paste the entire block into SSH, don't do line by line.

for phpver in $(whmapi1 php_get_installed_versions|grep -oE '\bea-php.*') ; do
cd ~
wget -O redis.tgz https://pecl.php.net/get/redis
tar -xvf redis.tgz
cd ~/redis* || exit
/opt/cpanel/"$phpver"/root/usr/bin/phpize
./configure --with-php-config=/opt/cpanel/"$phpver"/root/usr/bin/php-config
make clean && make install
echo 'extension=redis.so' > /opt/cpanel/"$phpver"/root/etc/php.d/redis.ini
rm -rf ~/redis*
done

/scripts/restartsrv_httpd
/scripts/restartsrv_apache_php_fpm