To install phpredis on CentOS 8 / RHEL 8, you can use the following steps:
- First, make sure that your system is up to date by running the command
sudo yum update
. - Install the PHP development tools and the Redis package by running the command
sudo yum install php-devel redis
. - 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
- Enable the PHP 8.0 module by running the command
sudo dnf module enable php:remi-8.0
. - Install the PHP extension for Redis by running the command
sudo dnf install php-pecl-redis
- Verify that the extension is installed and enabled by running the command
php -m | grep redis
- Finally, restart the web server (e.g. Apache or Nginx) by running the command
sudo systemctl restart httpd
orsudo 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.