How to Install phpredis on CentOS 8 / RHEL 8

To install phpredis on CentOS 8 / RHEL 8, you can use the following steps:

  1. First, make sure that your system is up to date by running the command sudo yum update.
  2. Install the PHP development tools and the Redis package by running the command sudo yum install php-devel redis.
  3. Next, you will need to enable the Remi repository by running the command sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
  4. Enable the PHP 8.0 module by running the command sudo dnf module enable php:remi-8.0.
  5. Install the PHP extension for Redis by running the command sudo dnf install php-pecl-redis
  6. Verify that the extension is installed and enabled by running the command php -m | grep redis
  7. Finally, restart the web server (e.g. Apache or Nginx) by running the command sudo systemctl restart httpd or sudo systemctl restart nginx

After completing these steps, phpredis should be installed and configured on your CentOS 8 / RHEL 8 system. You can then use the Redis functions in your PHP scripts.

Leave a Comment