I have a problem that I install \'Archive_Zip 0.1.1\' on Linux server, but when I try to run the script to create the zip file it gives the fatal error
<
PHP 5.2.0 and later
Linux systems
In order to use these functions you must compile PHP with zip support by using the --enable-zip configure option.
Windows
Windows users need to enable php_zip.dll inside of php.ini in order to use these functions.
For Centos 7 and PHP 7.3 on Remi
Search for the zip extension:
$ yum search php73 | grep zip
php73-php-pecl-zip.x86_64 : A ZIP archive management extension
The extension name is php73-php-pecl-zip.x86_64. To install it in server running single version of PHP, remove the prefix php73:
$ sudo yum --enablerepo=remi-php73 install php-pecl-zip #for server running single PHP7.3 version
$ #sudo yum --enablerepo=remi-php73 install php73-php-pecl-zip # for server running multiple PHP versions
Restart PHP:
$ sudo systemctl restart php-fpm
Check installed PHP extensions:
$ php -m
[PHP Modules]
apcu
bcmath
bz2
...
zip
zlib
For me work, first review
php -m
php -version
Later install the extension
apt-get update
apt-get install php7.2-zip
systemctl restart apache2
If you have WHM available it is easier.
Log in to WHM.
Go to EasyApache 4 (or whatever version u have) under Software tab.
Under Currently Installed Packages click Customize.
Go to PHP Extensions, in search type "zip" (without quotes),
you should see 3 modules
check all of them,
click blue button few times to finish the process.
This worked for me. Thankfully I've WHM available.
I had the same issue and it had solved using two command lines:
sudo apt install php-zip
then reboot your web server, for Apache
sudo service apache2 restart
For CentOS based server use
yum install php-pecl-zip.x86_64
Enable it by running: echo "extension=zip.so" >> /etc/php.d/zip.ini