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_register_cancel_callback_with_state), /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
PHP Unable to load dynamic library zip.so after upgrade.
Resolution
Firstly, check there are no php-package conflicts. Remove/uninstall existing php-packages from system & then reinstall the latest PHP version from RHEL repositories.
With command $ rpm -qa | grep php one can check existing php packages.
The library zip.so is not loaded because of missing libzip dependency of module php-pecl-zip.
==================================================================================================================
Package Architecture Version Repository Size
==================================================================================================================
Installing:
php-pecl-zip x86_64 1.18.2-1.module+el8.3.0+6678+b09f589e @rhel-8-for-x86_64-appstream-rpms 134 k
Installing dependencies:
libzip x86_64 1.6.1-1.module+el8.3.0+6678+b09f589e @rhel-8-for-x86_64-appstream-rpms 112 k
Transaction Summary
==================================================================================================================
Remove 2 Packages
Solution 2- If one is able to see zip module after running command # php -m and still getting Unable to load dynamic library 'zip.so' error follow below steps:
If output looks something like above, remove libzip.so.5 => /usr/local/lib/libzip.so.5 (0x00007fad7a5e0000) & rebuild it, as module libzip.so.5 is getting loaded from a different location.
It should look like libzip.so.5 => /lib64/libzip.so.5 (0x00007fad7a5e0000)
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Here are the common uses of Markdown.
Code blocks
~~~
Code surrounded in tildes is easier to read
Links/URLs
[Red Hat Customer Portal](https://access.redhat.com)
Learn more
Are you sure you want to request a translation?
We appreciate your interest in having Red Hat content localized to your language. Please note that excessive use of this feature could cause delays in getting specific content you are interested in translated.