#StackBounty: #apt #software-installation #php #imagemagick Upgrade to imagemagick7 and force php to use it

Bounty: 50

I have Ubuntu 18.04.1 LTS which comes with ImageMagick 6.9.7 by default and I wanted ImageMagick to process jp2 images so I installed libopenjp2-7-dev and also installed imagemagick7 from a source like this:

wget https://www.imagemagick.org/download/ImageMagick.tar.gz 
tar xvzf ImageMagick.tar.gz
cd ImageMagick-7.0.10-22
sudo make install
sudo ldconfig /usr/local/lib

magick -version shows the right one:

Version: ImageMagick 7.0.10-22 Q16 x86_64 2020-07-02 https://imagemagick.org
Copyright: © 1999-2020 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP(4.5)
Delegates (built-in): jng jp2 jpeg png xml zlib

But in phpinfo() it shows:

imagick module version  3.4.4
imagick classes Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel
Imagick compiled with ImageMagick version   ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org
Imagick using ImageMagick library version   ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org

I even tried to remove the ImageMagick** 6.9.7 and the PHP-Imagick extension, I thought that by reinstalling the extension with only a version available, it will somehow point at that but the extension couldn’t be installed without imagemagick6. I’m out of ideas on how to make PHP use the ImageMagick 7.

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.