Unable to load dynamic library imagick.so

Hello all,

good day.

im at a loss with trying to get the following issue fixed:

im getting the following error after upgrading to Ubuntu 20.04 from 19.10

this is what im getting multiple times:

PHP Startup: Unable to load dynamic library ‘imagick.so’ (tried: /usr/lib/php/20180731/imagick.so (libIlmImf-2_2.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/imagick.so.so (/usr/lib/php/20180731/imagick.so.so: cannot open shared object file: No such file or directory)) at Unknown#0

PHP Version is 7.3:
$ php -v
PHP Warning: PHP Startup: Unable to load dynamic library ‘imagick.so’ (tried: /usr/lib/php/20180731/imagick.so (libIlmImf-2_2.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/imagick.so.so (/usr/lib/php/20180731/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 7.3.18-1+ubuntu19.10.1+deb.sury.org+1 (cli) (built: May 14 2020 10:35:22) ( NTS )
Copyright © 1997-2018 The PHP Group
Zend Engine v3.3.18, Copyright © 1998-2018 Zend Technologies
with Zend OPcache v7.3.18-1+ubuntu19.10.1+deb.sury.org+1, Copyright © 1999-2018, by Zend Technologies

the folder /usr/lib/php/20180731 exists and contains imagick.so, but somehow its not being loaded.

can any one provide any advice?

much appreciated!!

so, i was able to get the issue to go away by uninstalling imagick completely.

now im getting this when trying to install it

$ sudo apt install php-imagick
Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
php-imagick : Depends: phpapi-20190902
E: Unable to correct problems, you have held broken packages.

now in the settings of my server i get the following:

This instance is missing some recommended PHP modules. For improved performance and better compatibility it is highly recommended to install them.

imagick

Anyone that’s experiencing the same?

So what worked for me was to install ppa:ondrej/php
Did apt update and then install php7.4 php-imagick
Restarted Apache and that was it.