I am trying to install the Zip extension of my PHP container built from php:7.4-fpm-alpine
This is what I am using in my Dockerfile
RUN apk add --no-cache zip libzip-dev
RUN docker-php-ext-configure zip --with-libzip=/usr/include
RUN docker-php-ext-install zip
But it is giving me this error:
configure: error: unrecognized options: --with-libzip ERROR: Service 'php' failed to build : The command '/bin/sh -c docker-php-ext-configure zip --with-libzip=/usr/include' returned a non-zero code: 1
The solution is as simple as removing the
docker-php-ext-configure zip --with-libzip
line entirely for PHP >= 7.4. Defaults are sufficient.
As commented by hackel on their issue tracker: https://github.com/laradock/laradock/issues/2421#issuecomment-567728540
So a working Dockerfile would be:
FROM php:7.4-fpm-alpine
RUN apk add --no-cache \
libzip-dev \
zip \
&& docker-php-ext-install zip
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With