Close Menu
    Facebook X (Twitter) Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook X (Twitter) Instagram
    TecAdmin
    You are at:Home»Control Panel»WHM/cPanel»How to Install Redis on cPanel

    How to Install Redis on cPanel

    By RahulApril 2, 20182 Mins Read

    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

    Related Posts

    How to Install and Configure Redis on macOS: Boost Your Application Performance

    How to Install And Configure Redis on Ubuntu & Debian

    How to Change Redis Max Memory

    View 6 Comments

    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

    Advertisement
    Recent Posts
    • How to Change Port in Next.Js
    • Ubuntu 24.04 LTS: The Future of Open-Source Excellence
    • How to Execute Linux Commands in Python
    • Creating MySQL User with GRANT OPTION
    • Where to find crontab (cron) logs in Ubuntu & Debian
    Facebook X (Twitter) Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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