Missing php-redis repository in docker debian stretch image

✔ Recommended Answer

If you use php:7.1-fpm-stretch container, all php-*** packages are blocked for installation, see detail here: https://github.com/docker-library/php/issues/713

This leads to the following documentation in their github repository:

Which explains the following:

The proper solution to this error is to either use FROM debian:XXX and install Debian's PHP packages directly, or to use docker-php-ext-install, pecl, and/or phpize to install the necessary additional extensions and utilities.

Source: stackoverflow.com

Answered By: Lan Phan

Method #2

If you're encountering a missing php-redis repository issue when using the Debian Stretch Docker image, it could be due to a missing or outdated package repository. Here's how you can fix this issue:

  1. Update the package repository on your Docker image by running the following command:

    apt-get update
  2. Install the required dependencies by running the following command:

    apt-get install -y git wget php-dev libhiredis-dev
  3. Clone the phpredis repository by running the following command:

    git clone https://github.com/phpredis/phpredis.git /usr/src/phpredis
  4. Change to the directory where the phpredis repository was cloned and build the phpredis extension by running the following commands:

    cd /usr/src/phpredis phpize ./configure --enable-redis-igbinary make make install
  5. Add the following line to your php.ini file to enable the phpredis extension:

  6. Restart your PHP service to apply the changes by running the following command:

    service php7.3-fpm restart

By following these steps, you should be able to install and enable the phpredis extension in your Debian Stretch Docker image. Note that you may need to modify some of the commands above based on your specific Docker image setup.


Most Popular

PhpStorm, return value is expected to be 'A', 'object' returned

Remove Unicode Zero Width Space PHP

Laravel file upload returns forbidden 403, file permission is 700 not 755