Enable redis module on php – nginx webserver

Date Posted:12-02-2017

Redis is a in memory cache used as database cache, database to serve the page faster. We are not going to deal with how the application works, usage,etc., Refer redis official documentation to get to know the use case,etc.,

Prerequisites:
  1. Ubuntu 16
  2. Nginx webserver
  3. Php

If webserver or php not installed then follow the below post.

Install Nginx, Php, MariaDB on Ubuntu 16.04

Enable Redis Module:

Clone the redis module on the server.

cd /usr/local/src/

git clone https://github.com/phpredis/phpredis.git

Move the redis folder to /etc directory.

mv phpredis/ /etc/ && cd /etc/phpredis

Run phpize command.

phpize

Run the configure.

./configure

Compile and install the program.

make && make install

Add the extension to the enable redis module.

echo 'extension=redis.so' >/etc/php/7.0/mods-available/redis.ini

Enable the module

phpenmod redis

Restart the webserver.

 service nginx restart

service php7.0-fpm restart

Verification:

Create phpinfo and check the redis module.

vi /var/www/html/info.php

<?php

phpinfo();

?>

Access the page on the browser using the domain or IP address and we can see redis module.

http://IPaddress/info.php

admin

Our team has expertise across software and web development, WordPress, e-commerce, mobile applications, UI/UX, cloud and infrastructure, DevOps, CI/CD, API integration, security, testing, automation, and technical support. The team also works with AI-based software solutions, LLMs, AI workflows, AI agents, and intelligent application development to help businesses automate processes and build smarter digital solutions. We focus on developing, deploying, maintaining, and optimising secure, scalable, and reliable technology solutions while helping businesses adopt modern technologies and drive digital transformation.

Leave a Reply

Scroll to Top