Php: pecl does not work under alpine versions

Created on 18 Apr 2017  路  3Comments  路  Source: docker-library/php

I am trying to convert my PHP image from php:7.0-zts to php:7.0-zts-alpine, but I havent yet found how to make pecl work

phpize is missing

Most helpful comment

phpize should be available, but the dependencies it requires are not; I've had success just now building the following on my machine:

FROM php:7.0-fpm-alpine

RUN apk add --no-cache \
        $PHPIZE_DEPS \
        openssl-dev

RUN pecl install mongodb-1.2.5
RUN docker-php-ext-enable mongodb

All 3 comments

phpize should be available, but the dependencies it requires are not; I've had success just now building the following on my machine:

FROM php:7.0-fpm-alpine

RUN apk add --no-cache \
        $PHPIZE_DEPS \
        openssl-dev

RUN pecl install mongodb-1.2.5
RUN docker-php-ext-enable mongodb

oh phpize is not installed when $PHPIZE_DEPS is not installed

FROM php:7.0-zts-alpine

RUN apk add --no-cache \
        $PHPIZE_DEPS \
    && pecl install pthreads \
    && docker-php-ext-enable pthreads

actually works...

I find it a bit sad to have to reinstall all of $PHPIZE_DEPS. Couldn't this be handled trough a package.xml?

Was this page helpful?
0 / 5 - 0 ratings