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 use the zscan command in PHP with Redis?
- How can I use PHP to increment values in Redis using ZINCRBY?
- How can I use PHP and Redis to retrieve data from a sorted set using ZRANGEBYSCORE?
- How can I use PHP and Redis to get a reverse range of scores?
- How can I use Redis with the Yii PHP framework?
- How do I delete a key in PHP using Redis?
- How do I install Predis on Ubuntu using PHP?
- How do I save an object in Redis using PHP?
See more codes...