Question

PHP 7.0 - ZipArchive Library is missing or disabled

After setting up a new 512mb web server droplet using: Ubuntu 14.04 // NGINX // PHP7.0 // MariaDB // Wordpress

I get the following error message using my backup app:

PHP ZipArchive Library is missing or disabled

I never encountered this error before on my other droplets with identical configs so I guess this is a recent change in some package. Strangely plugin via wordpress backend unzip/install works fine.

Does anyone know how to enable this feature with php7.0?


Here are the relevant entries from my php-info file: PHP Version 7.0.3-8+deb.sury.org~trusty+2

Additional .ini files parsed        /etc/php/7.0/fpm/conf.d/20-zlib.ini
Registered PHP Streams	compress.zlib, phar
Registered Stream Filters       zlib.*

ZLib Support	enabled
Stream Wrapper	compress.zlib://
Stream Filter	zlib.inflate, zlib.deflate
Compiled Version	1.2.8
Linked Version	1.2.8
zlib.output_compression	Off	Off
zlib.output_compression_level	-1	-1
zlib.output_handler	no value	no value

I know it says zlib.output_compression Off Off but I have the same setting on another droplet and there it works the only difference on my other droplets is that PHP7 was installed as an upgrade to PHP5 while on my faulty droplet PHP7 was installed not as an update


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

KFSys
Site Moderator
Site Moderator badge
June 12, 2023
Pinned Answer

Heya,

The error message “PHP ZipArchive Library is missing or disabled” means that the PHP ZipArchive extension, which is required by your backup application, is not installed or enabled on your server.

To install and enable this extension, you can run the following command:

sudo apt-get install php7.0-zip

After running this command, you will need to restart your PHP service (which in your case appears to be php-fpm) for the changes to take effect:

sudo service php7.0-fpm restart

If the ZipArchive extension is already installed but just disabled, you can enable it by modifying your php.ini file. You can locate this file using the command:

php --ini

Once you’ve located the php.ini file, open it using a text editor, find the line that looks like ;extension=zip.so, uncomment it by removing the semicolon (;), then save and exit. Finally, restart the PHP service as described above.

If you don’t see a line like ;extension=zip.so, then it’s likely that the extension isn’t installed, and you should run the apt-get install command as shown above.

Andrew SB
DigitalOcean Employee
DigitalOcean Employee badge
February 24, 2016

When upgrading to PHP 7, you should make sure to install the PHP 7 versions of you libraries as well. The PPA providing PHP 7 also provides a php7.0-zip package. You can install it with:

sudo apt-get install php7.0-zip

To see additional PHP 7 libraries that are available, run:

sudo apt-cache search php7.0-*

After doing

sudo apt-get install php7.0-zip

don’t forget to restart Apache

sudo service apache2 restart

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.