Skip to content

missing ZIP extension causes double download in composer #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
simonthum opened this issue Jan 5, 2015 · 11 comments
Closed

missing ZIP extension causes double download in composer #60

simonthum opened this issue Jan 5, 2015 · 11 comments

Comments

@simonthum
Copy link

I'm wary of php enought not to know wheter this is #8 but the ZIP extension seems missing.

I'm using composer and it fetches stuff like

  • Installing phpunit/phpunit (3.7.31)
    Downloading: 100%
    Failed to download phpunit/phpunit from dist: Could not decompress the archive, enable the PHP zip extension.
    A php.ini file does not exist. You will have to create one.
    Now trying to download from source
    • Installing phpunit/phpunit (3.7.31)
      Cloning d24e9877331039582497052cc3c4d9f465b88210

Guessing from execution times it does download twice.

@tianon
Copy link
Member

tianon commented Jan 5, 2015

That sounds like it needs a docker-php-ext-install zip:

FROM php:5.6
RUN apt-get update && apt-get install -y zlib1g-dev \
    && docker-php-ext-install zip

@simonthum
Copy link
Author

Takes considerable time but since it saves downloading git too it seems a net win. Thanks!

@simonthum simonthum changed the title missing ZIP extension caues double download in composer missing ZIP extension causes double download in composer Jan 7, 2015
skyred added a commit to skyred/docker-drupal that referenced this issue Aug 4, 2015
Drupal uses Composer a lot; especially Drupal 8, and there are a lot of modules, requiring composer, are being back ported to Drupal 7. Composer use PHP zip extension. Otherwise, see docker-library/php#60
skyred added a commit to skyred/docker-drupal that referenced this issue Oct 9, 2015
Drupal uses Composer a lot; especially Drupal 8, and there are a lot of modules, requiring composer, are being back ported to Drupal 7. Composer use PHP zip extension. Otherwise, see docker-library/php#60
skyred added a commit to skyred/docker-drupal that referenced this issue Oct 9, 2015
Drupal uses Composer a lot; especially Drupal 8, and there are a lot of modules, requiring composer, are being back ported to Drupal 7. Composer use PHP zip extension. Otherwise, see docker-library/php#60

Also add zip extension to Drupal 7.
@Aliance
Copy link

Aliance commented Oct 21, 2016

@tianon for me docker-php-ext-install zip suits okay, without zlib1g-dev – can you explain its necessity?

@guizoxxv
Copy link

@Aliance The php zip extension requires zlib wich is a data-compression library. That's why you have to install zlib1g-deb first.

@yuklia
Copy link

yuklia commented Aug 28, 2017

@tianon i don't get why your solution doesn't work for me. maybe because of php version? i have 7.1

checking for the location of zlib... configure: error: zip support requires ZLIB. Use --with-zlib-dir=<DIR> to specify prefix where ZLIB

@yosifkit
Copy link
Member

@yuklia, I am unable to reproduce. Using php:7.1, I only get that error if I run docker-php-ext-install zip without first installing zlib1g-dev. 😕

@datgs
Copy link

datgs commented Nov 1, 2017

For one whole want to find an alternative solution with zlib: use bitnami/php-fpm (or can learn from that docker file where zlib extension installed well).

@qiangli
Copy link

qiangli commented Mar 2, 2019

for php:7.3-apache, this is what I had to do:

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

@jelhan
Copy link

jelhan commented Oct 2, 2019

For php:7-3 only lib-zip-dev seems to be required:

docker run --rm -it php:7.3 sh -c "apt-get update && apt-get install -y libzip-dev && docker-php-ext-install zip"

@sumit3021kumar
Copy link

sumit3021kumar commented Jan 20, 2020

That sounds like it needs a docker-php-ext-install zip (its working for me)

@neonexxa
Copy link

for me php:7-4 this one work docker-php-ext-install zip with RUN apt-get install libzip-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests