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
<
First of all, The solution for remote server:
If you are using cpanel you may have zip extension installed but not activate. You need to active it. For this case you need to go to cpanel > inside software section > click on PHP version. Then find zip and check it. Now save.
You should see like the image.
Refresh page. The error should disappear.
Note: If you dont found, contact server provider. They will install for you.
On ubuntu desktop, I had to do.
sudo apt-get install php5.6-zip
This installed the library but I still kept on getting the same error, so I had to restart apache using:
sudo service apache2 restart
and it worked.
I faced this issue on GCP while deploying wordpress in the App Engine Standard environment. This solved it :
sudo apt-get install php7.2-zip
Try to write \ZIPARCHIVE
instead of ZIPARCHIVE
.
This worked
apt-get install php7.0-zip
and no need to restart php7.0-fpm
manually.
Unpacking
php7.0-zip
(7.0.16-4+deb.sury.org~trusty+1
) ...
Processing triggers forphp7.0-fpm
(7.0.11-1+deb.sury.org~trusty+1
) ...
php7.0-fpm
stop/waiting
php7.0-fpm
start/running, process 1572
php7.0-fpm
stop/waiting
php7.0-fpm
start/running, process 1777
Setting upphp7.0-zip
(7.0.16-4+deb.sury.org~trusty+1
) ...
locale: Cannot setLC_ALL
to default locale: No such file or directoryCreating config file
/etc/php/7.0/mods-available/zip.ini
with new version
Processing triggers forphp7.0-fpm
(7.0.11-1+deb.sury.org~trusty+1
) ...
php7.0-fpm
stop/waiting
php7.0-fpm
start/running, process 2354
php7.0-fpm
stop/waiting
php7.0-fpm
start/running, process 2397
You also need to compile PHP with zip support. The manual says the following:
In order to use these functions you must compile PHP with zip support by using the --enable-zip configure option.
It's not enough to simply install the correct extensions on the server. Have a look at the installation instructions link Pekka posted earlier. My answer is just a clarification of his.