Php: docker-php-ext-install zip fails

Created on 12 Jan 2015  路  6Comments  路  Source: docker-library/php

It requires the zlib system package, a workaround is to add this to your Dockerfile

RUN apt-get update && \
    apt-get install -y \
        zlib1g-dev

Most helpful comment

If it helps anyone using the Alpine image, I succeeded with zlib-dev.

All 6 comments

Fixed via documentation in docker-library/docs#130.

If it helps anyone using the Alpine image, I succeeded with zlib-dev.

for php:7.3-apache/debian

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --fix-missing \
    apt-utils \
    gnupg

RUN echo "deb http://packages.dotdeb.org jessie all" >> /etc/apt/sources.list
RUN echo "deb-src http://packages.dotdeb.org jessie all" >> /etc/apt/sources.list
RUN curl -sS --insecure https://www.dotdeb.org/dotdeb.gpg | apt-key add -

RUN apt-get update && apt-get install -y \
    zlib1g-dev \
    libzip-dev
RUN docker-php-ext-install zip

If it helps anyone using the Alpine image, I succeeded with zlib-dev.

In Alpine I have to install libzip-dev too: apk add libzip-dev

Did anyone get this working?

FROM php:7.4-fpm-alpine

WORKDIR /var/www/html

RUN docker-php-ext-install pdo pdo_mysql zip

I get the zlib needed error. I added the code above but it says apk-get is not found.

EDIT:

this worked:

RUN apk add --no-cache zip libzip-dev
RUN docker-php-ext-configure zip
RUN docker-php-ext-install zip
RUN docker-php-ext-install pdo pdo_mysql 
Was this page helpful?
0 / 5 - 0 ratings