PHP intl extension in Docker container PHP intl extension in Docker container php php

PHP intl extension in Docker container


Your code worked perfectly for me once I added a space before the backslash terminating the second line of the run command:

RUN apt-get -y update \&& apt-get install -y libicu-dev \ ### <-- Added space here&& docker-php-ext-configure intl \&& docker-php-ext-install intl


It seems some requirements are missing. The snippet below worked for me:

ARG PHP_VERSION=5.6FROM php:${PHP_VERSION}-fpm-jessieapt-get install -y zlib1g-dev libicu-dev g++ \&& docker-php-ext-configure intl \&& docker-php-ext-install intl


Unfortunately, some php extensions have dependencies to other programs. There is a project called docker-php-extension-installer that you can use to install PHP extensions. It will make sure that the required dependencies are present as well. See https://stackoverflow.com/a/56224300/413531 for an example how I actually integrate it in a Dockerfile.