How to Install the Redis Module for PHP on a cPanel Server

Step 1: Log in to your server

Log in to your cPanel server using your SSH client of choice.

Step 2: Install the Redis module for PHP

To install the Redis module for PHP on a specific version of PHP, you can use the pecl command with the appropriate path to the version of PHP you want to install the module for. Run one of the following commands to install the Redis module for the desired PHP version:

For PHP 7.2:

echo no | /opt/cpanel/ea-php72/root/usr/bin/pecl install redis

For PHP 7.3:

echo no | /opt/cpanel/ea-php73/root/usr/bin/pecl install redis

For PHP 7.4:

echo no | /opt/cpanel/ea-php74/root/usr/bin/pecl install redis

For PHP 8.0:

echo no | /opt/cpanel/ea-php80/root/usr/bin/pecl install redis

For PHP 8.1:

echo no | /opt/cpanel/ea-php81/root/usr/bin/pecl install redis

For PHP 8.2:

echo no | /opt/cpanel/ea-php82/root/usr/bin/pecl install redis

Follow the on-screen prompts to complete the installation. If prompted to provide any input, type "no" and hit enter.

Step 3: Verify the Redis module is enabled

To verify that the Redis module is enabled for the version of PHP you installed it for, you can use the php -m command to list all of the enabled PHP modules. Run the following command to check if the Redis module is enabled:

For PHP 7.2:

/opt/cpanel/ea-php72/root/usr/bin/php -m | grep redis

For PHP 7.3:

/opt/cpanel/ea-php73/root/usr/bin/php -m | grep redis

For PHP 7.4:

/opt/cpanel/ea-php74/root/usr/bin/php -m | grep redis

For PHP 8.0:

/opt/cpanel/ea-php80/root/usr/bin/php -m | grep redis

For PHP 8.1:

/opt/cpanel/ea-php81/root/usr/bin/php -m | grep redis

For PHP 8.2:

/opt/cpanel/ea-php82/root/usr/bin/php -m | grep redis

If the Redis module is installed and enabled, you should see an output similar to the following:

redis

That's all! You have learned how to install the PHP module for Redis on the cPanel server.

  • 8 Users Found This Useful
Was this answer helpful?

Related Articles

How to fix IP Missing issue on cPanel/WHM

We are here to help you with solving the problem of Missing IP Server in list accounts. The...

Domain names are not showing in WHM

We were unable to see any domains listed under WHM -> List Accounts. However, we can see the...

How to Start/Stop or Restart Apache server

Apache is the HTTP server that is freely available over the internet. It is a kind of software or...

How to install Attracta SEO Tools plugin

RequirementscPanel/WHM needs to be installed on your server. Step 1: SSH into your server and go...

How to Install CpCleaner in cPanel through SSH?

Installation Run the following shell commands as root via SSH: wget -O cpc-1.0.3.tar...