Class 'ZipArchive' not found after php install and apache server restart

Viewed 28

I'm getting the error "Class 'ZipArchive' not found" even after php-zip install and apache restart. I'm currently running the project on Ubuntu 20.04

2 Answers

Probably you are running php as an apache module using libapache2-mod-php7.4, try to switch over to fpm by installing php7.4-fpm and libapache2-mod-fcgid.

Apache won't load a module / library if there is a version incompatibility and probably this is happening with your installation.

It should solve your problem. This article will guide you through the installation of php-fpm

https://www.digitalocean.com/community/tutorials/how-to-configure-apache-http-with-mpm-event-and-php-fpm-on-ubuntu-18-04

Though it is for ubuntu 18, but same will work on ubuntu.

Note PHP-FPM will speed up your web application as well.

Makesure the version is same as your php, if your php version is 7.4 the command would be :

sudo apt-get install php7.4-zip
Related