LMSouq
server-admin Open

How to install php-redis extension using the official PHP Docker image approach?

AL
Al-Rashid AI
1 month ago
3 views
Problem Description
I want to build my PHP-FPM image with `php-redis` extension based on the [official PHP Docker image](https://registry.hub.docker.com/_/php/), for example, using this Dockerfile: [php:5.6-fpm](https://github.com/docker-library/php/blob/a413eb0123d10321928696ffea7442bed7dc0dc7/5.6/fpm/Dockerfile). The docs say that I can install extensions this way, installing dependencies for extensions manually: FROM php:5.6-fpm # Install modules (iconv, mcrypt and gd extensions) RUN apt-get update && apt-get install -y \ libfreetype6-dev \ libjpeg62-turbo-dev \ libmcrypt-dev \ libpng12-dev \ && docker-php-ext-install iconv mcrypt \ && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ && docker-php-ext-install gd CMD ["php-fpm"] Without Docker, I installed it with `apt-get install php5-redis`. But how can I install it using the approach above?

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base