0

I've upgraded our company's webserver to Debian 10 Buster recently. Our website is using a legacy CMS that cannot run on PHP versions newer than 7.0. It requires the imagick extension to be present. Unfortunately, the official debian package php-imagick is only available for PHP 7.3. What's good and sustainable way to install the Image Magick extension for PHP 7.0 on my Buster install?

2 Answers2

2

You already got PHP 7.0 on your Debian Buster somewhere, despite it comes with PHP 7.3. That's most likely from the DEB.SURY.ORG repository, which also has a suitable version of php-imagick:

$ apt-cache show php-imagick
Package: php-imagick
Version: 3.4.4-4+0~20200302.14+debian10~1.gbp2925ae
. . .
Provides: php5.6-imagick, php7.0-imagick, php7.1-imagick ...

But it also shows you this official Debian 10 Buster version:

Package: php-imagick
Version: 3.4.3-4.1
. . .
Provides: php7.3-imagick

I tested on a Debian 10 Buster with the Sury repository, and the one from Sury was installed by default just by using apt-get install php-imagick. However, if it didn't, you could choose to install this version through the php7.0-imagick it provides:

$ sudo apt-get install php7.0-imagick
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'php-imagick' instead of 'php7.0-imagick'

This php-imagick will be the one from DEB.SURY.ORG.

But next time, please think through all your dependencies before rushing to upgrade the OS.

Esa Jokinen
  • 46,944
  • 3
  • 83
  • 129
  • In fact, Buster gave me the option to install PHP 7.0, but not all of the PHP extensions. Anyhow, using the Sury repository solved my problem. Thank you! – Fester Bestertester May 03 '20 at 18:34
0

Unfortunately there is not a "good and sustainable" way

Your options appear to be:

  1. Upgrade CMS
  2. Downgrade to Jessie
  3. Compile PHP/modules and ImageMagick from source on Buster

Compiling all from source will take some time and effort and would likely work eventually but is no small job. Would possibly need re-compilation in the future. In short, not a straightforward task .

Peleion
  • 303
  • 1
  • 7