PHP error: "The zip extension and unzip command are both missing, skipping."
Solution 1:
Depending on your flavour of Linux and PHP version these may vary.
(sudo) yum install zip unzip php-zip
(sudo) apt install zip unzip php-zip
This is a very commonly asked question, you'll be able to find more useful info in the aether by searching <distro> php <version> zip extension
.
Solution 2:
For servers with PHP 5.6
sudo apt-get install zip unzip php5.6-zip
Solution 3:
Not to belabor the point, but if you are working in a Dockerfile
, you would solve this particular issue with Composer by installing the unzip
utility. Below is an example using the official PHP image to install unzip
and the zip
PHP extension for good measure.
FROM php:7.4-apache
# Install Composer
COPY --from=composer /usr/bin/composer /usr/bin/composer
# Install unzip utility and libs needed by zip PHP extension
RUN apt-get update && apt-get install -y \
zlib1g-dev \
libzip-dev \
unzip
RUN docker-php-ext-install zip
This is a helpful GitHub issue where the above is lovingly lifted from.
Solution 4:
For Debian Jessie (which is the current default for the PHP image on Docker Hub):
apt-get install --yes zip unzip php-pclzip
You can omit the --yes, but it's useful when you're RUN-ing it in a Dockerfile.