Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Control Panel»WHM/cPanel»How to Install Redis on cPanel

    How to Install Redis on cPanel

    RahulBy RahulMarch 21, 20182 Mins ReadUpdated:April 2, 2018

    Redis is an in-memory data structure store, used as database server, cache and message broker. It also provides PHP module for communication between PHP script with Redis server.

    This guide will help you for the installation of Redis server and binding with PHP using Redis PHP extensions on a cPanel server.

    Step 1 – Prerequisites

    In order to use this tutorial, you must have root shell access of your WHM/cPanel server. Login to your server shell access using root account.

    ssh [email protected]
    

    Redis packages are not available under default yum repositories. You need to enable EPEL yum repository on your server first. Execute below command to enable:

    ### CentOS/RHEL 7 
    yum install epel-release
    
    ### CentOS/RHEL 6 
    rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    

    Step 2 – Install Redis Server

    Now, You can use yum package manage to install Redis server packages by executing below command

    yum install redis
    

    After successfully installation start Redis service and enable to auto-start on system reboot.

    ### CentOS/RHEL 7 
    systemctl enable redis
    systemctl start redis
    
    ### CentOS/RHEL 6 
    chkconfig redis on
    service redis restart
    

    Redis server is up and running on your system. Go to next step to enable Redis PHP extension on your cPanel server.

    Step 3 – Install Redis PHP extension

    In this step there are two option available based in the EasyApache version on your cPanel server. Follow one of below step:

    cPanel with EasyApache 4

    You can install Redis PHP extension for all installed PHP version on your system or install for the active version only. We recommend to install for all versions.

    PHP 5.6

    /opt/cpanel/ea-php56/root/usr/bin/pecl install igbinary igbinary-devel redis 
    /opt/cpanel/ea-php56/root/usr/bin/php -m | grep redis
    

    PHP 7.0

    /opt/cpanel/ea-php70/root/usr/bin/pecl install igbinary igbinary-devel redis 
    /opt/cpanel/ea-php70/root/usr/bin/php -m | grep redis
    

    PHP 7.1

    /opt/cpanel/ea-php71/root/usr/bin/pecl install igbinary igbinary-devel redis 
    /opt/cpanel/ea-php71/root/usr/bin/php -m | grep redis
    

    cPanel with EasyApache 3

    If the cPanel is still running with EasyApache 3, Execute below commands to install Redis PHP extension on your system. Also check Redis module is enabled for PHP.

    pecl install igbinary igbinary-devel redis
    php -m | grep redis
    

    All done. Redis has been installed on your system along with the PHP extension.

    cpanel redis redis-php whm
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Install Redis on Ubuntu 18.04 & 16.04 LTS
    Next Article How to Install Redis Cache Server on CentOS 7/6

    Related Posts

    How to Install Redis on Debian 11 Linux

    Updated:September 16, 20213 Mins Read

    How to Rename MySQL Database

    Updated:July 26, 20213 Mins Read

    How To Install Redis on Debian 10

    Updated:July 7, 20203 Mins Read

    How to Install Redis on Ubuntu 20.04

    3 Mins Read

    How to Install Redis on CentOS 8

    3 Mins Read

    How To Delete All Data in Redis

    Updated:February 27, 20201 Min Read

    6 Comments

    1. Tushar on October 19, 2021 9:51 am

      I tried this steps but not able to install redis 6.x. can you give more steps for latest version
      thanks

      Reply
    2. Hadafnet Web Hosting Co on May 12, 2021 3:44 am

      great tutorial.. very useful

      Reply
    3. Isolde van Oosterhout on January 23, 2020 2:15 pm

      Neat and clean tutorial, thank you!

      Reply
    4. Ashraf on May 14, 2019 5:37 am

      Thank you, this article help m to install Redis.

      Reply
    5. Farhad on April 29, 2019 7:37 pm

      Hello,

      thanks for your great article
      How can I update redis to latest version?

      The current version installed via this article is 4.2 but the newest version is 5

      Your insight is appreciated. thank you

      Reply
    6. Ryan on March 14, 2019 3:13 am

      Thank you for this helpful tutorial. I’ve installed Redis and Predis smoothly and was able to create two instances with successful connectivity test. But now i am stuck at implemneting Redis via LiteSpeed WordPress cache where i have to mention the database ID and password. I understand that the ID should be between 0 and 16 but what I don’t understand is that should i create these database manual in prior and where can i actually specify the password so i can past it accordingly into LSWP configuration.

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • What is CPU? – Definition, Types and Parts
    • What is the /etc/aliases file
    • What is the /etc/nsswitch.conf file in Linux
    • How to Install Ionic Framework on Ubuntu 22.04
    • What is the /etc/hosts file in Linux
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.