简体   繁体   English

Class 在 php 安装和 apache 服务器重启后找不到“ZipArchive”

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

I'm getting the error "Class 'ZipArchive' not found" even after php-zip install and apache restart.即使在 php-zip 安装和 apache 重新启动后,我也收到错误“未找到类‘ZipArchive’”。 I'm currently running the project on Ubuntu 20.04我目前正在 Ubuntu 20.04 上运行该项目

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.可能您正在使用 libapache2-mod-php7.4 将 php 作为 apache 模块运行,尝试通过安装 php7.4-fpm 和 libapache2-mod-fcgid 切换到 fpm。

Apache won't load a module / library if there is a version incompatibility and probably this is happening with your installation.如果版本不兼容,Apache 将不会加载模块/库,并且您的安装可能会发生这种情况。

It should solve your problem.它应该可以解决您的问题。 This article will guide you through the installation of php-fpm本文将指导您完成 php-fpm 的安装

https://www.digitalocean.com/community/tutorials/how-to-configure-apache-http-with-mpm-event-and-php-fpm-on-ubuntu-18-04 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.虽然它适用于 ubuntu 18,但同样适用于 ubuntu。

Note PHP-FPM will speed up your web application as well.注意PHP-FPM 也会加速您的 web 应用程序。

Makesure the version is same as your php, if your php version is 7.4 the command would be:确保版本与您的 php 相同,如果您的 php 版本为 7.4,则命令为:

sudo apt-get install php7.4-zip

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM