mlocati/docker-php-extension-installer

Can't install yaml and redis extensions on php8.2-fpm

Closed this issue · 3 comments

Version of install-php-extensions

2.1.1

Error description

When I'm trying to install either yaml or redis on php8.2-fpm image I get this error.

INSTALLING REMOTE MODULE yaml

No releases available for package "pecl.php.net/yaml"
install failed

Docker image

php:8.2-fpm

Minimal Dockerfile

FROM php:8.2-fpm

ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

RUN chmod +x /usr/local/bin/install-php-extensions && sync && \
    install-php-extensions pdo_mysql bcmath yaml

It's working for me:

PS C:\test> Get-Content .\Dockerfile
FROM php:8.2-fpm

ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

RUN chmod +x /usr/local/bin/install-php-extensions && sync && \
    install-php-extensions pdo_mysql bcmath yaml

RUN php --ri pdo_mysql && php --ri bcmath && php --ri yaml

PS C:\test> docker build --progress plain --no-cache .
[...omissis...]
#8 [4/4] RUN php --ri pdo_mysql && php --ri bcmath && php --ri yaml
#8 sha256:4b8f8a669c5c2c07a206ab98261ee2fecd19f502dfee11174f223ecc16f995fa
#8 0.442
#8 0.442 pdo_mysql
#8 0.442
#8 0.442 PDO Driver for MySQL => enabled
#8 0.442 Client API version => mysqlnd 8.2.3
#8 0.442
#8 0.442 Directive => Local Value => Master Value
#8 0.442 pdo_mysql.default_socket => no value => no value
#8 0.450
#8 0.450 bcmath
#8 0.450
#8 0.450 BCMath support => enabled
#8 0.450
#8 0.450 Directive => Local Value => Master Value
#8 0.450 bcmath.scale => 0 => 0
#8 0.458
#8 0.458 yaml
#8 0.458
#8 0.458 LibYAML Support => enabled
#8 0.458 Module Version => 2.2.2
#8 0.458 LibYAML Version => 0.2.2
#8 0.458
#8 0.458 Directive => Local Value => Master Value
#8 0.458 yaml.decode_binary => 0 => 0
#8 0.458 yaml.decode_timestamp => 0 => 0
#8 0.458 yaml.decode_php => 0 => 0
#8 0.458 yaml.output_canonical => 0 => 0
#8 0.458 yaml.output_indent => 2 => 2
#8 0.458 yaml.output_width => 80 => 80
#8 DONE 0.5s

Maybe it was a transient network error?
Maybe the PECL website was down?

It's working for me:

PS C:\test> Get-Content .\Dockerfile
FROM php:8.2-fpm

ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

RUN chmod +x /usr/local/bin/install-php-extensions && sync && \
    install-php-extensions pdo_mysql bcmath yaml

RUN php --ri pdo_mysql && php --ri bcmath && php --ri yaml

PS C:\test> docker build --progress plain --no-cache .
[...omissis...]
#8 [4/4] RUN php --ri pdo_mysql && php --ri bcmath && php --ri yaml
#8 sha256:4b8f8a669c5c2c07a206ab98261ee2fecd19f502dfee11174f223ecc16f995fa
#8 0.442
#8 0.442 pdo_mysql
#8 0.442
#8 0.442 PDO Driver for MySQL => enabled
#8 0.442 Client API version => mysqlnd 8.2.3
#8 0.442
#8 0.442 Directive => Local Value => Master Value
#8 0.442 pdo_mysql.default_socket => no value => no value
#8 0.450
#8 0.450 bcmath
#8 0.450
#8 0.450 BCMath support => enabled
#8 0.450
#8 0.450 Directive => Local Value => Master Value
#8 0.450 bcmath.scale => 0 => 0
#8 0.458
#8 0.458 yaml
#8 0.458
#8 0.458 LibYAML Support => enabled
#8 0.458 Module Version => 2.2.2
#8 0.458 LibYAML Version => 0.2.2
#8 0.458
#8 0.458 Directive => Local Value => Master Value
#8 0.458 yaml.decode_binary => 0 => 0
#8 0.458 yaml.decode_timestamp => 0 => 0
#8 0.458 yaml.decode_php => 0 => 0
#8 0.458 yaml.output_canonical => 0 => 0
#8 0.458 yaml.output_indent => 2 => 2
#8 0.458 yaml.output_width => 80 => 80
#8 DONE 0.5s

Maybe it was a transient network error? Maybe the PECL website was down?

Well I'm still having it from yesterday, do you have any other solution? The rest of the packages are installing fine, but the yaml one is not. While installing I get warning that it couldn't connect to pecl through HTTP at first and tries HTTPS and then starts installing the first two but at when it reaches yaml I get No releases available for package "pecl.php.net/yaml"

Well as the issue persisted which I'm pretty sure is something wrong with internet connection of my provider or something similar I did it manually, just gonna put it here if anyone gets here:

RUN apt-get update -y && apt-get install libyaml-dev -y

WORKDIR /tmp

ADD yaml-2.2.2.tgz .

RUN tar -xvf yaml-2.2.2.tgz

WORKDIR /tmp/yaml-2.2.2

RUN phpize

RUN ./configure

RUN make

RUN make install

RUN echo "extension=yaml.so" >> "$PHP_INI_DIR/php.ini-production"

//install the rest with this repository

RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"