Fatal error: Uncaught Error: Class "ZipArchive" not found in 오류 해결
본문
Fatal error: Uncaught Error: Class "ZipArchive" not found in /home/ec2-user/www/lib/PHPExcel/Reader/Excel2007.php:85 Stack trace: #0 /home/ec2-user/www/lib/PHPExcel/IOFactory.php(281): PHPExcel_Reader_Excel2007->canRead() #1 /home/ec2-user/www/lib/PHPExcel/IOFactory.php(191): PHPExcel_IOFactory::createReaderForFile() #2 /home/ec2-user/www/adm/shop_admin/itemexcelupdate.php(27): PHPExcel_IOFactory::load() #3 {main} thrown in /home/ec2-user/www/lib/PHPExcel/Reader/Excel2007.php on line 85
답변 1
[root@ip-172-26-4-219 www]# yum install php81-php-pecl-zip
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
279 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package php81-php-pecl-zip.x86_64 0:1.20.0-1.el7.remi will be installed
--> Processing Dependency: libzip5(x86-64) >= 1.8.0 for package: php81-php-pecl-zip-1.20.0-1.el7.remi.x86_64
--> Processing Dependency: libzip.so.5()(64bit) for package: php81-php-pecl-zip-1.20.0-1.el7.remi.x86_64
--> Running transaction check
---> Package libzip5.x86_64 0:1.8.0-2.el7.remi will be installed
--> Processing Dependency: libzstd(x86-64) >= 1.3.6 for package: libzip5-1.8.0-2.el7.remi.x86_64
--> Processing Dependency: libzstd.so.1()(64bit) for package: libzip5-1.8.0-2.el7.remi.x86_64
--> Running transaction check
---> Package libzstd.x86_64 0:1.5.2-1.amzn2 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==================================================================================================================================
Package Arch Version Repository Size
==================================================================================================================================
Installing:
php81-php-pecl-zip x86_64 1.20.0-1.el7.remi remi-safe 55 k
Installing for dependencies:
libzip5 x86_64 1.8.0-2.el7.remi remi-safe 64 k
libzstd x86_64 1.5.2-1.amzn2 amzn2-core 284 k
Transaction Summary
==================================================================================================================================
Install 1 Package (+2 Dependent packages)
Total download size: 403 k
Installed size: 1.0 M
Is this ok [y/d/N]: y
Downloading packages:
(1/3): libzstd-1.5.2-1.amzn2.x86_64.rpm | 284 kB 00:00:00
(2/3): php81-php-pecl-zip-1.20.0-1.el7.remi.x86_64.rpm | 55 kB 00:00:01
(3/3): libzip5-1.8.0-2.el7.remi.x86_64.rpm | 64 kB 00:00:02
----------------------------------------------------------------------------------------------------------------------------------
Total 146 kB/s | 403 kB 00:00:02
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libzstd-1.5.2-1.amzn2.x86_64 1/3
Installing : libzip5-1.8.0-2.el7.remi.x86_64 2/3
Installing : php81-php-pecl-zip-1.20.0-1.el7.remi.x86_64 3/3
Verifying : libzstd-1.5.2-1.amzn2.x86_64 1/3
Verifying : libzip5-1.8.0-2.el7.remi.x86_64 2/3
Verifying : php81-php-pecl-zip-1.20.0-1.el7.remi.x86_64 3/3
Installed:
php81-php-pecl-zip.x86_64 0:1.20.0-1.el7.remi
Dependency Installed:
libzip5.x86_64 0:1.8.0-2.el7.remi libzstd.x86_64 0:1.5.2-1.amzn2
Complete!
[root@ip-172-26-4-219 www]# systemctl restart php81-php-fpm