Php: PHP8.0-alpha1: PECL not found

Created on 27 Jun 2020  路  5Comments  路  Source: docker-library/php

Hello,

I'm trying to use an image for PHP 8.0, but pecl command does not exist:

For example:

...
&& pecl install apcu && docker-php-ext-enable apcu \
...

For PHP 7.4: docker run php:7.4.7-apache-buster pecl

Output:

E:\PROJEKTY\intranet>docker run php:7.4.7-apache-buster pecl
Commands:
build                  Build an Extension From C Source
bundle                 Unpacks a Pecl Package
channel-add            Add a Channel
...

For PHP 8.0-alpha1: docker run php:8.0.0alpha1-apache-buster pecl

Output:

E:\PROJEKTY\intranet>docker run php:8.0.0alpha1-apache-buster pecl
/usr/local/bin/docker-php-entrypoint: 9: exec: pecl: not found

It seems to me that the PHP team did something from the PECL repository but I can't find any information about it.

Okay, I found information for Dockerfile PHP 7.4:

https://github.com/docker-library/php/blob/b6fd2f70018163227f0f18f3ba1fa4d70e6d929e/7.4/buster/apache/Dockerfile#L227

but there is not that line in Dockerfile PHP 8.0.

Is there any replacement for installing this repository?

Most helpful comment

Okey,

so in PHP 8.0 instead

...
&& pecl install apcu && docker-php-ext-enable apcu \
...

should be:

...
&& mkdir -p /usr/src/php/ext/apcu && curl -fsSL https://pecl.php.net/get/apcu | tar xvz -C "/usr/src/php/ext/apcu" --strip 1 && docker-php-ext-install apcu \
...

or use a pickle utility directly

RUN wget https://github.com/FriendsOfPHP/pickle/releases/download/v0.6.0/pickle.phar && mv pickle.phar /usr/local/bin/pickle
pickle install apcu

In my case, both work.

All 5 comments

Okey,

so in PHP 8.0 instead

...
&& pecl install apcu && docker-php-ext-enable apcu \
...

should be:

...
&& mkdir -p /usr/src/php/ext/apcu && curl -fsSL https://pecl.php.net/get/apcu | tar xvz -C "/usr/src/php/ext/apcu" --strip 1 && docker-php-ext-install apcu \
...

or use a pickle utility directly

RUN wget https://github.com/FriendsOfPHP/pickle/releases/download/v0.6.0/pickle.phar && mv pickle.phar /usr/local/bin/pickle
pickle install apcu

In my case, both work.

or use a pickle utility directly

In my case I also had to:

RUN chmod +x /usr/local/bin/pickle

In my case I also had to

docker-php-ext-install zip

before being able to use pickle

```sh
FROM php:8.0.0RC2-fpm

Pickle

RUN set -ex \
&& apt-get update \
&& apt-get install -y \
libzip-dev \
&& docker-php-ext-install -j$(nproc) zip \
&& curl -L -o /usr/local/bin/pickle https://github.com/FriendsOfPHP/pickle/releases/download/v0.6.0/pickle.phar \
&& chmod +x /usr/local/bin/pickle
````

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ihorsamusenko picture ihorsamusenko  路  4Comments

mcnesium picture mcnesium  路  3Comments

cmath10 picture cmath10  路  3Comments

solocommand picture solocommand  路  3Comments

PMExtra picture PMExtra  路  3Comments