9951 explained code solutions for 126 technologies


predisHow to install Redis on Red Hat 8 using PHP?


  1. Install the Redis package from the Red Hat 8 repository:
sudo dnf install redis
  1. Start the Redis service:
sudo systemctl start redis
  1. 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
  1. Configure the Redis service to start automatically when the system boots:
sudo systemctl enable redis
  1. Install the PHP Redis extension:
sudo dnf install php-pecl-redis
  1. Restart the Apache web server to make the PHP Redis extension available:
sudo systemctl restart httpd
  1. Verify the installation of the PHP Redis extension:
php -m | grep redis

Output example

redis

Helpful links

Edit this code on GitHub