How to Install Redis and PHP-Redis on cPanel

How to Install Redis and PHP-Redis on cPanel

Redis is an open source in-memory data structure store vast amounts of data without the limits of a relational database. Caching with Redis will automatically flush the cache when new content is published. If a page is edited or a new content is posted on your website, the Redis cache for that content will be invalidated to avoid dirty cache and will be updated after the next page load.


Install Redis on the server.

Login to the server via SSH and do the following steps.

1) Download the following rpm to the server using the below commands.

# wget

# wget

Run the following commands to install Redis on the server.

# rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

# yum install –y redis

Now the redis is installed on the server and we need to enable the Radis to start it automatically upon server reboot.

# chkconfig redis on


2) After installation, we need to configure Redis. Follow the below steps to configure it.

Open the Redis configuration file and add the below lines at the end of the file:

vi /etc/redis.conf

maxmemory 256mb

maxmemory-policy allkeys-lru


3) We need to install php redis extension, for that, we need to login to WHM and Search for “Module Installers” under “Software” section. Navigate to “Module Installers” page and then click on the Manage link for the “PHP Pecl”.

Install Redis


On the PHP Pecl Installer page search type “redis” and hit the “Go” button.

Install Redis


Then click on the “Install” link from the results of the Redis extension to complete the installation.

Install Redis


4) Finally, we need to restart the Redis and httpd services to enable the changes.

# service httpd restart

# service redis restart


If you need any further help please do reach our support department.