docker-php-extension-installer
docker-php-extension-installer copied to clipboard
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
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
Same here. Fails at imagick install due to pecl.php.net being down.
Aaaaand pecl is back. If you're still running into this issue then it's a separate issue and i'm sorry for derailing.
[0/1] Re-running CMake...
This issue has been already reported multiple times, but since I can't replicate it, I can't fix it.
See also https://github.com/mlocati/docker-php-extension-installer/issues/614#issuecomment-1202846906.
Can confirm everything works fine since pecl.php.net is back up. As this is a common issue that pops up every so often, perhaps a solution would be to download from mirrors if there are any?
Edit: and it's down again 21:50 UK........ terrible host. Unfortunately there don't seem to be any official mirrors. However there are unofficial ones that provide original packages. Including those mirrors and doing a hash check could be the answer?
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...
An alternative would be to download and build each extension. This is basically what pecl is doing anyway. The tricky part is handling latest/different versions.
eg:
curl -fsSL https://github.com/xdebug/xdebug/archive/refs/tags/$XDEBUG_VERSION.tar.gz -o xdebug.tar.gz \
&& mkdir -p /tmp/xdebug \
&& tar -xf xdebug.tar.gz -C /tmp/xdebug --strip-components=1 \
&& rm xdebug.tar.gz \
&& docker-php-ext-configure /tmp/xdebug --enable-xdebug \
&& docker-php-ext-install /tmp/xdebug \
&& rm -r /tmp/xdebug
I'm not going to search where the source code resides for every extension, given also that it may change across time.
Hmm still happening for me... so must be unrelated to the pecl servers. Seems hard to reproduce, I actually got 1 successful build but I need to be able to build this full container. I guess I'll keep trying. Has anybody found any workarounds?
EDIT: FYI after re-building again, it did compile successfully. I'm not sure if caching would be involved here (I'm using the same docker tag in a completely modified dockerfile, so I don't think so), but so far I'm able to get this built at least after a re-try.
Also, it might help to add more messaging or information on why C-Make is failing... I looked in the log folder but there's not a simple "cmake.log" or anything I could find to specifically add to this issue, so wasn't sure where to find that.
i run this individual to check wich extension fail:
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 install-php-extensions gd
RUN install-php-extensions curl
RUN install-php-extensions imap
RUN install-php-extensions intl
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 zip
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
a solution may be to add something that allows a retry of the installation if it fails... about 3 times...
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'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
@arcanisgk thx!
I'm also having similar problems with different php-extensions. Here for example with zip:
FROM php:8.1-fpm-bullseye
RUN set -ex; \
IPE_GD_WITHOUTAVIF=1 \
install-php-extensions zip
Error during build in Dockerfile:
#22 92.30 + docker-php-ext-install -j12 zip
#22 92.30 make: *** No rule to make target 'zip', needed by 'all'. Stop.
------
failed to solve: executor failed running [/bin/bash -c set -ex; IPE_GD_WITHOUTAVIF=1 install-php-extensions zip]: exit code: 2
The funny thing is.... skipping installing extensions in my custom build and running exactly the same command in the running docker-container works!
# docker-php-ext-install -j12 zip
It's driving me crazy as I'm juggling around on this now a few days trying to get it working. And always during Dockerfile build it's crashing, but running it in the build container works.
What can be the reason for this?!
I also can't install some extensions (apcu/grpc/imagick, etc) Always the same error : #0 35.70 ### INSTALLING REMOTE MODULE apcu ### #0 35.86 No releases available for package "pecl.php.net/apcu" #0 35.86 install failed
@chosroes
I also can't install some extensions (apcu/grpc/imagick, etc) Always the same error : #0 35.70 ### INSTALLING REMOTE MODULE apcu ### #0 35.86 No releases available for package "pecl.php.net/apcu" #0 35.86 install failed
It's maybe a transient problem caused by pecl.php.net website being down or inaccessible by you? What's the output of this command for you?
curl -sSLf -o /dev/null https://pecl.php.net/get/apcu
curl -sSLf -o /dev/null https://pecl.php.net/get/apcu
Or even better:
curl -sSLf https://pecl.php.net/rest/r/apcu/allreleases.xml
I get this :
<a xmlns="http://pear.php.net/dtd/rest.allreleases" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://pear.php.net/dtd/rest.allreleases http://pear.php.net/dtd/rest.allreleases.xsd">
apcu
So, pecl is working for you (maybe it was a transient problem).
Could you try to run install-php-extensions apcu
again now?
In my case I could not install xmlrpc
, consistently over three tries.
install-php-extensions xmlrpc
...
#12 46.08 ### INSTALLING REMOTE MODULE xmlrpc ###
#12 46.08 (installing version beta)
#12 46.16 No releases available for package "pecl.php.net/xmlrpc"
#12 46.16 install failed
I am using php:8.1
@qleroy Same answer as above
Seems like this keeps happening at random. In my case different errors pop up when installing xdebug at random builds. Once I retry building my image a couple times everything goes ok. Weird stuff
It's either:
No releases available for package "pecl.php.net/xdebug"
or
Package "xdebug" does not have REST info xml available
That's caused by network problems (likely the pecl webserver is down).
There's nothing I can do about that.
I'm still thinking about the possibility of a validation interface prior to the installation of packages that validates which packages have problems... the truth is that I like to do it through the terminal when I work with linux but it s[t]uck when errors appear in the middle of an installation from docker... when trying to run an automated install script...
the time is gold...
A few months ago I used this: https://github.com/arcanisgk/docker-lamp-stack I want to think that the extension repositories are still working correctly.