Updated: 22 October 2026 · Applies to: Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9 and cPanel & WHM
CentOS 8 is end of life; these steps are for Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9. phpredis is the PHP extension that lets PHP applications (Laravel, WordPress object cache, Magento) talk to Redis or Valkey quickly.
AlmaLinux / Rocky Linux 9
The extension comes with the PHP module stream from AppStream:
dnf module reset php && dnf module enable php:8.3 dnf install php-pecl-redis6 systemctl restart php-fpm
Ubuntu 24.04 / Debian 12
apt install php-redis systemctl restart php8.3-fpm # php8.2-fpm on Debian 12
cPanel & WHM
cPanel's EasyApache does not include phpredis. Install it with WHM › Software › Module Installers › PHP PECL: choose the PHP version, enter redis and click Install Now. Repeat for each PHP version you use.
Check
php -m | grep redis php --ri redis
Also install the Redis or Valkey server itself (see "How to install Redis 4 on Centos 6 / 7, Ubuntu 16 and Debian 8 (Updated)?"). In Laravel, set REDIS_CLIENT=phpredis in .env.