Recommended way to install redis on WHM (CentOS 7)

greektranslator

Well-Known Member
Jun 5, 2011
104
8
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
Staff member
Nov 14, 2017
13,296
1,271
313
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
7,496
1,009
313
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