How to enable ZipArchive on PHP 7.4

Written by James McDonald

March 30, 2020

Ubuntu / Debian

Find the extension version you want to install

# install 
apt-get install php7.4-zip

# enable it
phpenmod -v 7.4 zip

# check it is enabled 
php7.4 -i | grep -i zip
# restart any services such as php7.4-fpm.service to pick up the change
systemctl restart php7.4-fpm.service


yum install php-zip
# restart Apache or php-fpm

This is on CentOS Linux release 7.7.1908 (Core)

You will know you have it installed properly when you run the following code and it returns true

// enter this in a file such as phpzip.php
php phpzip.php

On CentOS using the remi-php74 repository it add a 40-zip.ini file into /etc/php.d/ with the contents of

; Enable ZIP extension module


Submit a Comment

Your email address will not be published.

You May Also Like…


Zebra Printer Language The above website has a page where you can enter ZPL and it...

PHP Iterators

Just came across a Youtube talk "Iterators in PHP" by Jake Smith published in 2014 that steps through the many...

PHP array_map Multiple Arrays

array_map can take multiple arrays. I like how it starts mapping through them starting at the first element of each...