Skip to content

PHP8.0-alpha1: PECL not found #1029

Description

@michaljusiega

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:

# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear") and will be removed in PHP 8+; see also https://github.com/docker-library/php/issues/846#issuecomment-505638494

but there is not that line in Dockerfile PHP 8.0.

Is there any replacement for installing this repository?

Activity

  1. tianon commented on Jun 27, 2020

    @tianon
    Member

    See #851

  2. michaljusiega commented on Jun 27, 2020

    @michaljusiega
    Author

    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.

  3. josefsabl commented on Aug 20, 2020

    @josefsabl

    or use a pickle utility directly

    In my case I also had to:

    RUN chmod +x /usr/local/bin/pickle
    
  4. eiriksm commented on Oct 6, 2020

    @eiriksm

    In my case I also had to

    docker-php-ext-install zip
    

    before being able to use pickle

  5. strarsis commented on Oct 20, 2020

    @strarsis
    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
  6. added a commit that references this issue on Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions