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:
but there is not that line in Dockerfile PHP 8.0.
Is there any replacement for installing this repository?
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
pickleutility 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
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
````
Most helpful comment
Okey,
so in PHP 8.0 instead
should be:
or use a
pickleutility directlyIn my case, both work.