简体   繁体   中英

PHP - ZipArchive is enabled but not found

When I look at phpinfo I see that Zip is enabled: 在此处输入图片说明

extension_loaded('zip') // <- returns true.
function_exists('zip_open') // <- returns true.
class_exists('ZipArchive', false) // <-returns false.

When I try to create a ZipArchive object, I get error: Fatal error: Class 'ZipArchive' not found

PHP Version 5.4.11

Found the fix by reading this mediatemple kb article. I already had zip.so in /usr/lib64/php/modules/

Thing missing was extension=zip.so entry in php.ini

After adding that entry and restarting Apache, ZipArchive is now recognized.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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