Ubuntu / Debian
Find the extension version you want to install

1 2 3 4 5 6 7 8 9 10 | # 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
1 2 | 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
1 2 3 | <?php // enter this in a file such as phpzip.php var_dump( class_exists ( 'ZipArchive' )); |
1 2 | 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
1 2 | ; Enable ZIP extension module extension=zip.so |
0 Comments