predisHow to install Redis on Red Hat 8 using PHP?
- Install the Redis package from the Red Hat 8 repository:
sudo dnf install redis
- Start the Redis service:
sudo systemctl start redis
- Check the status of the Redis service:
sudo systemctl status redis
Output example
● redis.service - Redis persistent key-value database
Loaded: loaded (/usr/lib/systemd/system/redis.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2020-07-09 11:30:50 UTC; 1min ago
Main PID: 2989 (redis-server)
Tasks: 4 (limit: 1186)
Memory: 4.2M
CGroup: /system.slice/redis.service
└─2989 /usr/bin/redis-server 127.0.0.1:6379
- Configure the Redis service to start automatically when the system boots:
sudo systemctl enable redis
- Install the PHP Redis extension:
sudo dnf install php-pecl-redis
- Restart the Apache web server to make the PHP Redis extension available:
sudo systemctl restart httpd
- Verify the installation of the PHP Redis extension:
php -m | grep redis
Output example
redis
Helpful links
More of Predis
- How can I use PHP and Redis to retrieve a range of values from a sorted set?
- How do I install PHP Redis on Ubuntu 20.04?
- How can I troubleshoot a "PHP Redis went away" error?
- How can I use Predis with a cluster in PHP?
- How do I use yum to install php-redis?
- How do I install and configure a PHP Redis DLL on a Windows machine?
- How can I check the version of PHP and Redis I am using?
- How can I configure TLS encryption for a connection between PHP and Redis?
- How do I use the rpush command in PHP with Redis?
See more codes...