简体   繁体   中英

DOCKER : ext-intl is missing

I'm actually working on a docker/Symfony 4.4 project.

I tried to install google/recaptcha via composer, but I got this error : - The requested PHP extension ext-intl * is missing from your system. Install or enable PHP's intl extension. - The requested PHP extension ext-intl * is missing from your system. Install or enable PHP's intl extension. 在此处输入图片说明

I don't get docker so well and how everything works as the lead installed it on my project and is not available to help me.

My php-fpm is :

FROM php:7.4.2-fpm-alpine

RUN apk add --update --no-cache \
    coreutils \
    php7-fpm \
    php7-apcu \
    php7-ctype \
    php7-curl \
    php7-dom \
    php7-gd \
    php7-iconv \
    php7-imagick \
    php7-json \
    php7-intl \
    php7-mcrypt \
    php7-fileinfo\
    php7-mbstring \
    php7-opcache \
    php7-openssl \
    php7-pdo \
    php7-pdo_mysql \
    php7-mysqli \
    php7-xml \
    php7-zlib \
    php7-phar \
    php7-tokenizer \
    php7-session \
    php7-simplexml \
    php7-xdebug \
    php7-zip \
    php7-xmlwriter \
    make \
    curl
RUN touch /usr/local/etc/php/conf.d/uploads.ini \
        && echo "upload_max_filesize = 100M;" >> /usr/local/etc/php/conf.d/uploads.ini
RUN docker-php-ext-install pdo pdo_mysql # solve "could not find driver" error.
RUN echo "$(curl -sS https://composer.github.io/installer.sig) -" > composer-setup.php.sig \
        && curl -sS https://getcomposer.org/installer | tee composer-setup.php | sha384sum -c composer-setup.php.sig \
        && php composer-setup.php && rm composer-setup.php* \
        && chmod +x composer.phar && mv composer.phar /usr/bin/composer

CMD ["php-fpm"]

EXPOSE 9000

If someone has got an idea to tell me how solve this issue, please? Thanks a lot !!

You need ext-intl extension in your docker container.

add to your Dockerfile:

RUN docker-php-ext-install -j$(nproc) \
    intl \

Open your php.ini file find :

;extension=intl
; remove semicolon

remove semicolon Like following

extension=intl

Problem solved : I removed this from the composer.json file

 "ext-intl" : "*"

And it works ! i'm not sure i understand why but... Thanks a lot for your help guys

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM