Skip to main content

How to install PHP pecl redis extension on cPanel with PHP 5.6 / PHP 7.0

Redis is a server that provides a key/value store. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes with radius queries.You can find more details about Redis on the Redis website.  To interact with the Redis server from your PHP scripts (client-server communication), you need to install PHP pecl Redis extension.

Install PHP pecl redis extension on cPanel with PHP 5.6/PHP 7.0

In this article I will show you how to install PHP pecl redis extension on cPanel 58 with PHP 5.6/ PHP 7.0. So, I believe you have already setup your Redis server. If not, please refer the following link to download and setup the Redis server.

Here, I am installing the Redis PHP PECL extension on a cPanel 58 server with EasyApache 4.

You can directly install Redis PHP PECL module from “WHM >> Software >> Module Installers” page for PHP 7.0.



However, if you try to install the Redis PHP PECL extension 3.0 on the server for PHP 5.6, the following error will pop up.

pecl/redis requires PHP (version >= 7.0.0, version <= 7.1.0, excluded versions: 6.0.0), installed version is 5.6.25
No valid packages found
install failed

It says you require atleast PHP 7.0 for installing Redis PHP pecl 3.0 extension.

So, the solution is to manually compile and install an older version of PECL redis extension using phpize command. Please follow the steps given below to achieve this.

cd /usr/local/src/
tar zxpf redis*
cd redis*
./configure --with-php-config=/opt/cpanel/ea-php56/root/usr/bin/php-config
make install

Once the installation went well, please don’t forget to add the following line to the PHP 5.6 php.ini configuration.

This will load Redis extension on your server. You can verify it using the command given below.

php -m | grep -i redis

It will show the redis extension. That’s it. We are done.

If you face any issues during the setup, please feel free to mail me or leave a comment below.

How to install PHP pecl redis extension on cPanel with PHP 5.6 / PHP 7.0
4.2 (83.33%) 6 vote[s]


TheGeeksAlive is all about Linux, Server Administration, Web Hosting and other Open Source Technologies.