ImageMagick version upgrade still using old library

  imagemagick, php, ubuntu

I remove the old version of ImageMagick 6.9.7-4 and install a new version ImageMagick-7.1.0-19. The php extension imagick seem to still point to an older version of ImageMagick that no longer exist. How can I remove the old library completely so the new version can show up?

$ ldd /opt/plesk/php/7.4/lib/php/modules/imagick.so
        linux-vdso.so.1 (0x00007ffcb976a000)
        libMagickWand-6.Q16.so.3 => not found
        libMagickCore-6.Q16.so.3 => not found
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f335973d000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f3359d96000)


$ php -r "print_r(Imagick::queryFormats());"
PHP Warning:  PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /opt/plesk/php/7.4/lib/php/modules/imagick.so (libMagickWand-6.Q16.so.3: cannot open shared object file: No such file or directory), /opt/plesk/php/7.4/lib/php/modules/imagick.so.so (/opt/plesk/php/7.4/lib/php/modules/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Fatal error:  Uncaught Error: Class 'Imagick' not found in Command line code:1
Stack trace:
#0 {main}
  thrown in Command line code on line 1

Source: Ask PHP

LEAVE A COMMENT