1

I am having problems getting October CMS to update:

Update failed "Class 'ZipArchive' not found" on line 51 of /var/www/html/jdd/htdocs/vendor/october/rain/src/Filesystem/Zip.php

And if I do php -m, i get the following warning:

PHP Warning: PHP Startup: Unable to load dynamic library 'zip.so' (tried: /usr/lib64/php/modules/zip.so (/usr/lib64/php/modules/zip.so: undefined symbol: zip_libzip_version), /usr/lib64/php/modules/zip.so.so (/usr/lib64/php/modules/zip.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Strange thing is, in my /etc/php.d/ folder, the zip.ini file contains the line: extension=zip.so. whereas all other .ini files in /php.d do not include the ".so" extension (eg: for the json.ini file, the line reads: extension=json). I have tried removing the ".so" from the zip.ini extension= line, but it still won't work.

As far as I know, the system is only running x86_64 executables (how do I check this with absolute certainty - all binaries are showing as .x86_64 or .noarch?).

I have tried other versions of php: -php 5.4 installs zip.so fine (it loads correctly), except October requires at least php 7.0. -php 7.0 to 7.3 all install zip.so, but the extension still does not load.

Can anyone help?

Plastopian
  • 13
  • 1
  • 1
  • 5
  • Okay, I figured out that the file extension of the PHP shared object name is now left out with PHP 7.3, so no error in my php.d/ .ini files there. Still stuck with the problem of an installed, but not recognised zip.so. – Plastopian Jan 19 '19 at 15:46

3 Answers3

4

I've got the same problem and found following solution:

  1. Search for installed php modules:

yum list installed | grep php*

  1. Try to locate installed php-zip module:

rpm -ql php72-php-pecl-zip

  1. You will see something like this:
/etc/opt/remi/php72/php.d/40-zip.ini
/opt/remi/php72/root/usr/lib64/php/modules/zip.so # <----
/opt/remi/php72/root/usr/share/doc/pecl/zip
  1. Then just create symlink to this file in directory where php searches modules by default:

ln -s /opt/remi/php72/root/usr/lib64/php/modules/zip.so /usr/lib64/php/modules/zip.so

After this steps I finally saw zip extension in php -m output and now can use class ZipArchive.

Also you should probably restart your httpd service.

  • 1
    Sorry, but this is not the right solution. See https://blog.remirepo.net/pages/English-FAQ#scl (so php-pecl-zip vs php72-php-pecl-zip) – Remi Collet Apr 23 '19 at 11:42
2

1 - Download manually the last ZIP pecl lib at https://pecl.php.net/package/zip

2 - Install it with pecl in the downloaded file

sudo pecl install zip-1.19.1.tgz

3 Enable zip on php.ini

extension=zip
Benjamin Loison
  • 3,782
  • 4
  • 16
  • 33
Adauto
  • 21
  • 1
  • I think this should be marked as solution. I had similar problem with Ubuntu 16.04 and ondrej ppa php7.4. After I did apt-get dist-upgrade zlib became newer then one ondrej used. Uninstalling php7.4-zip from ppa and installing from pecl solved issue (you need to install php7.4-dev and libzip-dev to be able to do that) – Krunoslav Djakovic Feb 07 '23 at 13:02
0

Please check you are using latest libzip5 version 1.5.1 from remi-safe repository (which is mandatory, and enabled by default)

Remi Collet
  • 6,198
  • 1
  • 20
  • 25
  • Remi, I have tried another repository with success. I must have somehow disabled the repo or missed enabling it. I am not sure if this was the problem, or not, - Could this have created the problem? – Plastopian Jan 21 '19 at 08:51
  • I will check on the next PHP install whether this was the reason, but for now, I will continue with what I have managed to install. Thanks! – Plastopian Jan 21 '19 at 08:57