@avbentem is right. We can help you if you can understand our help. Installing extensions can be tricky since you need to figure out what libraries that extension requires. This is why I created my own project where I installed many additional extensions for multiple versions of PHP. Unfortunately I… Answer from rimelek on forums.docker.com
GitHub
github.com › mlocati › docker-php-extension-installer
GitHub - mlocati/docker-php-extension-installer: Easily install PHP extensions in Docker containers · GitHub
This repository contains a script that can be used to easily install a PHP extension inside the official PHP Docker images.
Starred by 4.9K users
Forked by 432 users
Languages Shell 84.2% | PHP 13.8% | JavaScript 1.6%
docker-php-ext-install intl
Hello i'm beginner with docker and i want add the extension intl. In my file docker i write this: FROM php:7.4-apache RUN apt-get update && apt-get install -y \ zip \ unzip RUN curl -sS https://get... More on github.com
What do docker-php-ext-configure, docker-php-ext-install and docker-php-ext-enable do? - Stack Overflow
I'm trying to set up a LAMP web server using docker and was delighted to discover that the good folks over at php have put together a docker container for php. Reading through the documentation I ... More on stackoverflow.com
Install extension for php through exec command
Hello, i try to install extension for php through exec container command and it work for php but not for me) but i can’t use it inside my php file, example: $conf = new \RdKafka; ->Undefined class 'RdKafka' why does not it work for me and how can i force it? More on forums.docker.com
PHP extension are not getting install in Dockerfile
I am trying to run a docker-compose file for Magento 2. But getting stuck in a weird issue regarding the installation of the extension when I am building it via Dockerfile. Hear is my Dockerfile. FROM php:7.4-fpm # Install system dependencies RUN apt-get update && apt-get install -y \ libxml2-dev ... More on forums.docker.com
Videos
01:45
Installing the intl Extension on PHP Docker Image: A Step-by-Step ...
22:34
How to Install PHP Extensions in Docker Images - YouTube
21:40
Install PHP Extensions Easily in Docker - YouTube
08:10
PHP and Docker - PHP Dockerfile - YouTube
The Only Docker Tutorial You Need To Get Started
18:26
Everything You NEED to Know about Docker - YouTube
Docker Community
forums.docker.com › general
Can't install pdo_mysql with docker-php-ext-install - General - Docker Community Forums
November 30, 2022 - Hi! I need help, I can’t install pdo_mysql with docker-php-ext-install. I prepared a docker project on a local PC (Mac OSX). On the local PC, the PHP configuration is fine. When I deploy the project to the Debian server…
Docker Hub
hub.docker.com › _ › php
php - Official Image | Docker Hub
For example, if you want to have a PHP-FPM image with the gd extension, you can inherit the base image that you like, and write your own Dockerfile like this: FROM php:8.2-fpm RUN apt-get update && apt-get install -y \ libfreetype-dev \ libjpeg62-turbo-dev \ libpng-dev \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ && docker-php-ext-install -j$(nproc) gd Copy
GitHub
github.com › docker-library › php › issues › 1457
docker-php-ext-install intl · Issue #1457 · docker-library/php
November 1, 2023 - Hello i'm beginner with docker and i want add the extension intl. In my file docker i write this: FROM php:7.4-apache RUN apt-get update && apt-get install -y \ zip \ unzip RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ RUN chmod +x /usr/local/bin/install-php-extensions && \ docker-php-ext-configure intl && \ docker-php-ext-install intl && \ install-php-extensions @composer gd mysqli zip bcmath amqp
Author pws2016
Top answer 1 of 3
29
These are helper scripts that helps one install php extensions from source
- not all extensions are available in a distribution native package manager or pecl
- even if these exist one may want to configure these differently or optimize
Talking about the scripts
- docker-php-ext-configure - configure an extension before you build it with
docker-php-ext-install. It's executed bydocker-php-ext-install, so one should use it if wants to override the defaults - docker-php-ext-install - build extension from source, usually executes
docker-php-ext-configurefor build configuration, enables the extension (php.ini entry) by executingdocker-php-ext-enableafter all - docker-php-ext-enable - enables an already installed extension by adding a specific entry to php.ini. Extensions installed with pecl or native package managers may not be enabled by default thus require this additional step. As mentioned above, extensions installed with
docker-php-ext-installare being enabled automatically.
2 of 3
2
these functions can help to set-up your PHP configuration, if per example you want to add opcache to your PHP configuation:
firstly you configure as below :
docker-php-ext-configure gd \
--enable-gd-native-ttf \
--with-jpeg-dir=/usr/lib \
--with-freetype-dir=/usr/include/freetype2 && \
docker-php-ext-install gd \
and you install your configuration
&& docker-php-ext-install opcache
and then you can enable it
&& docker-php-ext-enable opcache
GitHub
gist.github.com › hoandang › 88bfb1e30805df6d1539640fc1719d12
Complete list of php docker ext · GitHub
RUN curl -sSL "http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz" -o ioncube.tar.gz && tar -xzf ioncube.tar.gz && mv ioncube/ioncube_loader_lin_8.1.so $(php-config --extension-dir) && rm -rf ioncube.tar.gz ioncube && docker-php-ext-enable ioncube_loader_lin_8.1 ·
Kinsta®
kinsta.com › home › resource center › blog › docker › how to install php dependencies and extensions with docker
How to install PHP dependencies and extensions with Docker - Kinsta®
February 18, 2026 - This extension isn’t compiled into the image by default, so install it using the following command in your Dockerfile: ... To write a Dockerfile for the demo application, create a new file named Dockerfile in the project root folder. Paste the following code in the file: FROM php:8.3-apache # Install MySQL client, server, and other dependencies RUN apt-get update && \ apt-get install -y \ default-mysql-client \ default-mysql-server \ git \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Install mysqli PHP extension for MySQL support RUN docker-php-ext-install mysqli
Docker Hub
hub.docker.com › r › mlocati › php-extension-installer
mlocati/php-extension-installer - Docker Image
This Docker container contains a script that can be used to easily install a PHP extension inside the official PHP Docker images.
Google
google.com › goto
Remote Development using SSH
November 3, 2021 - From here, install any extensions you want to use when connected to the host and start editing! Note: On ARMv7l / ARMv8l glibc SSH hosts, some extensions may not work due to x86 compiled native code inside the extension. If you are using a Linux or macOS SSH host, you can use the Remote - SSH and Dev Containers extensions together to open a folder on your remote host inside of a container. You do not even need to have a Docker ...
Docker Community
forums.docker.com › general
PHP extension are not getting install in Dockerfile - General - Docker Community Forums
March 21, 2024 - I am trying to run a docker-compose ... is my Dockerfile. FROM php:7.4-fpm # Install system dependencies RUN apt-get update && apt-get install -y \ libxml2-dev ......
Libhunt
php.libhunt.com › docker-php-extension-installer-alternatives
Docker PHP Extension Installer Alternatives - PHP Development Environment | LibHunt
April 4, 2026 - This repository contains a script that can be used to easily install a PHP extension inside the official PHP Docker images.