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

CentOS

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

<?php
// enter this in a file such as phpzip.php
var_dump(class_exists('ZipArchive'));
php phpzip.php
bool(true)

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
extension=zip.so

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Squarespace Image Export

To gain continued access to your Squarespace website images after cancelling your subscription you have several...

MySQL 8.x GRANT ALL STATEMENT

-- CREATE CREATE USER 'tgnrestoreuser'@'localhost' IDENTIFIED BY 'AppleSauceLoveBird2024'; GRANT ALL PRIVILEGES ON...

Exetel Opt-Out of CGNAT

If your port forwards and inbound and/or outbound site-to-site VPN's have failed when switching to Exetel due to their...