I am setting up very basic Docker container for a PHP and Zend framework project. I am using official Docker image php:fpm-alpine
. Container is running successfully and I am able to see my application. In order for Zend to work I need PHP intl
extention. When I add RUN docker-php-ext-install intl
command in DockerFile
extention is not installed successfully.
DockerFile code
FROM php:fpm-alpine
WORKDIR /usr/share/nginx/html
RUN docker-php-ext-install mysqli pdo pdo_mysql intl
Any help or recommendation is much appreciated. Thanks in advance.
The Internationalization extension (Intl) is a wrapper for the ICU library, a set of C/C++ and Java libraries that provide Unicode and Globalization support for software applications. It enables PHP programmers to perform UCA-conformant collation and date/time/number/currency formatting in their scripts.
docker-php-ext-install - build extension from source, usually executes docker-php-ext-configure for build configuration, enables the extension (php.ini entry) by executing docker-php-ext-enable after all. docker-php-ext-enable - enables an already extension by adding a specific entry to php. ini.
You can use docker run to create a container and execute PHP. You just need to add some volumes to the container. These volumes should include the paths to your code.
The installation of intl
extension is failing because a dependency is missing for it. Please update your Dockerfile with following and it should work.
FROM php:fpm-alpine
WORKDIR /usr/share/nginx/html
RUN apk add icu-dev
RUN docker-php-ext-install mysqli pdo pdo_mysql
RUN docker-php-ext-configure intl && docker-php-ext-install intl
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With