Puvox – Blog

Install Redis Cache for PHP-8

There may be some tricky parts involved, and to avoid spending hours, this steps might give you some help, to install Redis Cache for PHP-8 on linux/ubuntu OS.

Regular Install

  1. Install Redis system-wide: https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-redis-on-ubuntu-18-04
  2. Then install redis php-extension using (now industrial-standard declared) pickle:
    pickle install igbinary
    #then add extension=igbinary.so in php.ini
    pickle install redis
    and read that Github page to read use-case examples.

Docker

RUN apt install redis-server
RUN wget https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar && chmod +x pickle.phar && mv pickle.phar /usr/bin/pickle
RUN pickle install igbinary && docker-php-ext-enable igbinary #or add extension=igbinary.so in php.ini
RUN pickle install redis && docker-php-ext-enable redis #or add extension=redis.so in php.ini

Note: if using docker WSL, you might need “supervisor auto” instead of “systemd”, or manually start by: sudo service redis-server start (or adding in crontab to execute on every reboot: @reboot service redis-server start )

Exit mobile version