แก้ปัญหาเจอ Error - PHP Fatal error: Class 'ZipArchive' not found

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
View more smilies

BBCode is ON
[img] is ON
[flash] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: แก้ปัญหาเจอ Error - PHP Fatal error: Class 'ZipArchive' not found

แก้ปัญหาเจอ Error - PHP Fatal error: Class 'ZipArchive' not found

by mindphp » 30/01/2019 5:24 am

แก้ปัญหาเจอ Error - PHP Fatal error: Class 'ZipArchive' not found
ตัวอย่าง Error
PHP Fatal error: Class 'ZipArchive' not found in /var/www/mindphp/library/PHPExcel/PHPExcel/Writer/...
ปัญหามาจาก library PHPExcel ที่เรียกใช้ extension php-zip ด้วย คลาส ZipArchive

วิธีแก้คือ ติดตั้ง extension เสริมของ php

วิธีติดตั้ง
ด้วยคำสั่ง (OS Ubuntu)

Code: Select all

sudo apt-get install php7.0-zip
เมื่อติดตั้ง เสร็จ ลองรันคำสั่ง เพื่อเช็คว่า extension ทั้งหมด ที่เราลงไว้มีอะไรบ้างด้วยคำสั่ง

Code: Select all

sudo apt-cache search php7.0-*
ผลที่ได้
libapache2-mod-php7.0 - server-side, HTML-embedded scripting language (Apache 2 module)
php-all-dev - package depending on all supported PHP development packages
php7.0 - server-side, HTML-embedded scripting language (metapackage)
php7.0-cgi - server-side, HTML-embedded scripting language (CGI binary)
php7.0-cli - command-line interpreter for the PHP scripting language
php7.0-common - documentation, examples and common module for PHP
php7.0-curl - CURL module for PHP
php7.0-dev - Files for PHP7.0 module development
php7.0-gd - GD module for PHP
php7.0-gmp - GMP module for PHP
php7.0-json - JSON module for PHP
php7.0-ldap - LDAP module for PHP
php7.0-mysql - MySQL module for PHP
php7.0-odbc - ODBC module for PHP
php7.0-opcache - Zend OpCache module for PHP
php7.0-pgsql - PostgreSQL module for PHP
php7.0-pspell - pspell module for PHP
php7.0-readline - readline module for PHP
php7.0-recode - recode module for PHP
php7.0-snmp - SNMP module for PHP
php7.0-sqlite3 - SQLite3 module for PHP
php7.0-tidy - tidy module for PHP
php7.0-xml - DOM, SimpleXML, WDDX, XML, and XSL module for PHP
php7.0-xmlrpc - XMLRPC-EPI module for PHP
libphp7.0-embed - HTML-embedded scripting language (Embedded SAPI library)
php7.0-bcmath - Bcmath module for PHP
php7.0-bz2 - bzip2 module for PHP
php7.0-enchant - Enchant module for PHP
php7.0-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary)
php7.0-imap - IMAP module for PHP
php7.0-interbase - Interbase module for PHP
php7.0-intl - Internationalisation module for PHP
php7.0-mbstring - MBSTRING module for PHP
php7.0-mcrypt - libmcrypt module for PHP
php7.0-phpdbg - server-side, HTML-embedded scripting language (PHPDBG binary)
php7.0-soap - SOAP module for PHP
php7.0-sybase - Sybase module for PHP
php7.0-xsl - XSL module for PHP (dummy)
php7.0-zip - Zip module for PHP
php7.0-dba - DBA module for PHP

Top