docker-php-extension-installer: Unable to install extensions on PHP 8.1

Version of install-php-extensions

v.1.5.37

Error description

The command install-php-extensions gd intl pdo_mysql opcache zip is not working in a php:8.1-fpm docker container. I checked and each of these extensions appears to be supported for building in PHP 8.1 so I’m not sure the issue.

I get the following output after trying to install the extensions:

failed to solve: executor failed running [/bin/sh -c install-php-extensions gd intl pdo_mysql opcache zip]: exit code: 1

Along with a bunch of messages like this:

#0 111.9 [0/1] Re-running CMake...
#0 111.9 --- aom_configure: Detected CPU: x86_64
#0 112.4 -- Configuring done
#0 112.5 -- Generating done
#0 112.5 -- Build files have been written to: /tmp/src/tmp.vsLIEPDPzl/my.build
#0 112.5 [0/1] Re-running CMake...
#0 112.5 --- aom_configure: Detected CPU: x86_64
#0 113.0 -- Configuring done
#0 113.1 -- Generating done
#0 113.1 -- Build files have been written to: /tmp/src/tmp.vsLIEPDPzl/my.build
#0 113.1 [0/1] Re-running CMake...
#0 113.1 --- aom_configure: Detected CPU: x86_64
#0 113.6 -- Configuring done
#0 113.7 -- Generating done
#0 113.7 -- Build files have been written to: /tmp/src/tmp.vsLIEPDPzl/my.build
#0 113.7 [0/1] Re-running CMake...
#0 113.7 --- aom_configure: Detected CPU: x86_64
#0 114.2 -- Configuring done
#0 114.3 -- Generating done
#0 114.3 -- Build files have been written to: /tmp/src/tmp.vsLIEPDPzl/my.build
#0 114.3 [0/1] Re-running CMake...
#0 114.3 --- aom_configure: Detected CPU: x86_64
#0 114.8 -- Configuring done
#0 114.8 -- Generating done
#0 114.9 -- Build files have been written to: /tmp/src/tmp.vsLIEPDPzl/my.build
#0 114.9 [0/1] Re-running CMake...
#0 114.9 --- aom_configure: Detected CPU: x86_64
#0 115.4 -- Configuring done
#0 115.4 -- Generating done
#0 115.5 -- Build files have been written to: /tmp/src/tmp.vsLIEPDPzl/my.build

Docker image

php:8.1-fpm - same result on php:8.1-cli

Minimal Dockerfile

FROM  php:8.1-fpm

COPY --from=mlocati/php-extension-installer:latest /usr/bin/install-php-extensions /usr/bin/

RUN apt update && apt install git unzip -yq && \
    apt-get clean autoclean; apt-get autoremove --yes; rm -rf /var/lib/{apt,dpkg,cache,log}/

RUN install-php-extensions gd intl pdo_mysql opcache zip

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 27 (8 by maintainers)

Most upvoted comments

I’ve got same error only with gd extension and only on docker desktop for windows with wsl 2 backend, may be it wil help to reproduce and fix this error

i have use it:

RUN install-php-extensions pdo_mysql
RUN install-php-extensions Reflection
RUN install-php-extensions session
RUN install-php-extensions SimpleXML
RUN install-php-extensions SPL
RUN install-php-extensions sqlite3
RUN IPE_GD_WITHOUTAVIF=1 install-php-extensions gd
RUN install-php-extensions curl
RUN install-php-extensions imap
RUN IPE_ICU_EN_ONLY=1 install-php-extensions intl
RUN IPE_ICU_EN_ONLY=1 install-php-extensions http
RUN install-php-extensions json
RUN install-php-extensions mailparse
RUN install-php-extensions mbstring
RUN install-php-extensions readline
RUN install-php-extensions soap
RUN install-php-extensions xml
RUN install-php-extensions xmlrpc
RUN install-php-extensions bz2
RUN install-php-extensions zlib
RUN install-php-extensions dba
RUN install-php-extensions ldap
RUN install-php-extensions xdebug
RUN install-php-extensions @composer

I’ve got same error only with gd extension and only on docker desktop for windows with wsl 2 backend, may be it wil help to reproduce and fix this error

a solution would be to download from mirrors if there are any?

I’m not aware of any official mirror, and for security reasons I wouldn’t adopt any unofficial one…

Aaaaand pecl is back. If you’re still running into this issue then it’s a separate issue and i’m sorry for derailing.

I’m getting the same error but different output.

failed to solve: executor failed running [/bin/sh -c install-php-extensions @composer pdo_pgsql pgsql igbinary redis xdebug]: exit code: 1

In my case I’m getting connection timeout trying to connect to https://pecl.php.net. Maybe temporary pecl server issue. Re-running failed on a different extension, so pecl seems to be finicky right now. I’ve had this working for quite awhile and just ran into this for the first time right now…

Maybe unrelated since your output messages are different but thought I’d mention.

Edit: seems down

Screenshot from 2022-08-11 19-36-14