简体   繁体   English

PHP致命错误:未捕获错误:未在中找到类“ ZipArchive”

[英]PHP Fatal error: Uncaught Error: Class 'ZipArchive' not found in

I've been struggling with installing zip extension over PHP for a while now. 我一直在努力通过PHP安装zip扩展。 I keep getting an error message while trying to use ZipArchive: 尝试使用ZipArchive时,我不断收到错误消息:

PHP Fatal error: Uncaught Error: Class 'ZipArchive' not found in '...' PHP致命错误:未捕获错误:在“ ...”中找不到类“ ZipArchive”

The result of: php -m 结果: php -m

[PHP Modules]
calendar
Core
ctype
date
dom
exif
fileinfo`
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
openssl
pcntl
pcre
PDO
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

Result of sudo pecl list : sudo pecl list结果:

Installed packages, channel pecl.php.net:
=========================================
Package Version State
xdebug  2.5.5   stable
zip     1.15.2  stable

Also, phpinfo produced this result: 另外,phpinfo产生了以下结果: 在此处输入图片说明

It looks like zip is installed correctly. 看来zip已正确安装。

Is there anything else I'm missing? 还有什么我想念的吗?

Thanks. 谢谢。

check namespace, try use ZipArchive or new \\ZipArchive . 检查名称空间,尝试use ZipArchivenew \\ZipArchive otherwise, provide more info on the error message 否则,提供有关错误消息的更多信息

The secret for PHP 7.2: PHP 7.2的秘密:

sudo service httpd restart
sudo service php-fpm restart

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

相关问题 致命错误:未捕获的错误:找不到“ZipArchive”类 - Fatal error: Uncaught Error: Class 'ZipArchive' not found 致命错误:找不到类“ ZipArchive”(PHP 5.3.1) - Fatal error: Class 'ZipArchive' not found (PHP 5.3.1) 致命错误:找不到类“ZipArchive” - Fatal error: Class 'ZipArchive' not found in 致命错误:在PHP Excel库中的PHP 5.1.6中找不到类&#39;ZipArchive&#39; - Fatal error: Class 'ZipArchive' not found in php 5.1.6 in PHP excel library PHP致命错误:未捕获错误:找不到类 - PHP Fatal error: Uncaught Error: Class not found PHP致命错误:未捕获错误:找不到类&#39;Acme \\ RegisterUser&#39; - PHP Fatal error: Uncaught Error: Class 'Acme\RegisterUser' not found 致命错误:未捕获的错误:找不到类“Func”php - Fatal error: Uncaught Error: Class 'Func' not found php PHP 致命错误:未捕获的错误:找不到类“cake\\\\lib\\\\Dispatcher” - PHP Fatal error: Uncaught Error: Class 'cake\\lib\\Dispatcher' not found PHP - Phalcon致命错误:未捕获的错误:未在其中找到类“Phalcon\\Db” - PHP - Phalcon <b>Fatal error</b>: Uncaught Error: Class 'Phalcon\Db' not found in PHP致命错误:未捕获的错误:在Symfony上找不到类“ DOMDocument” - PHP Fatal error: Uncaught Error: Class 'DOMDocument' not found on Symfony
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM