BCcampus / pressbooks-openstax-import

[UNMAINTAINED] Pressbooks Plugin for OpenStax Textbook Import
GNU General Public License v3.0
5 stars 0 forks source link

Fatal error: Uncaught Error: Class 'ZipArchive' not found in /var/www/html/milnepublishing.geneseo.edu/wp-content/plugins/pressbooks-openstax-import/inc/import/openstax/class-cnx.php:54 #86

Closed rootl closed 5 years ago

rootl commented 5 years ago

Attempted import of OpenStax Zip file; also tried with Offline Zip file URL.

(Am able to import DOCX, XML, WXR, EPUB, other formats; resolved issues unrelated to the OpenStax plugin)

PHP error below:

Fatal error: Uncaught Error: Class 'ZipArchive' not found in /var/www/html/milnepublishing.geneseo.edu/wp-content/plugins/pressbooks-openstax-import/inc/import/openstax/class-cnx.php:54 Stack trace: #0 /var/www/html/milnepublishing.geneseo.edu/wp-content/plugins/pressbooks-openstax-import/pressbooks-openstax-import.php(111): BCcampus\Import\OpenStax\Cnx->__construct() #1 /var/www/html/milnepublishing.geneseo.edu/wp-includes/class-wp-hook.php(286): {closure}(Array) #2 /var/www/html/milnepublishing.geneseo.edu/wp-includes/plugin.php(203): WP_Hook->apply_filters(Array, Array) #3 /var/www/html/milnepublishing.geneseo.edu/wp-content/plugins/pressbooks/inc/modules/import/class-import.php(458): apply_filters('pb_initialize_i...', Array) #4 /var/www/html/milnepublishing.geneseo.edu/wp-content/plugins/pressbooks/inc/modules/import/class-import.php(262): Pressbooks\Modules\Import\Import::setImportOptions() #5 /var/www/html/milnepublishing.geneseo.edu/wp-includes/class-wp-hook.php(286): Pressbooks\Modules\Import\Import::formSubmit(' in /var/www/html/milnepublishing.geneseo.edu/wp-content/plugins/pressbooks-openstax-import/inc/import/openstax/class-cnx.php on line 54

Originally posted by @rootl in https://github.com/BCcampus/pressbooks-openstax-import/issues/85#issuecomment-458268822

bdolor commented 5 years ago

Hi Leah, still looks server related...you're missing a php extension. please see https://stackoverflow.com/questions/3872555/fatal-error-class-ziparchive-not-found-in

rootl commented 5 years ago

Ok, works now. From what I found out, Zip apparently needs to be installed separately for RHEL/CentOS PHP 7.3 . I had not encountered this with previous updates of PHP nor other RHEL/CentOS servers. Thank you so much for helping us through this!

For others out there who may be on RHEL/CentOS: 1) cd to /etc/php.d 2) yum install php-pecl-zip 3) Restart httpd service 4) ls -l or check if zip.ini is in /etc/php.d 5) Alternatively, rpm -qi php-pecl-zip

https://tecadmin.net/install-php7-on-centos7/ https://stackoverflow.com/questions/49583881/how-can-i-install-ziparchive-on-php-7-2-with-centos-7