Getting Imagemagick to run

I guess technically this is not really Virtualmin-related, but I've seen posts about it in the forum here and I am trying to get this working on a Virtualmin server, and some of what I've done involved working with Virtualmin.

I've followed instructions located in various places to install Imagemagick:

yum install gcc php-devel php-pear
yum install ImageMagick ImageMagick-devel
pecl install imagick
echo "" > /etc/php.d/imagick.ini
systemctl restart httpd

After the pecl install imagick command I got reams of output indicating "deprecated" errors (as just about all posts I've found on the Web about Imagemagick also show), but at the end it also indicated:

Build process completed successfully
Installing '/usr/lib64/php/modules/'
Installing '/usr/include/php/ext/imagick/php_imagick_shared.h'
install ok: channel://
configuration option "php_ini" is not set to php.ini location
You should add "" to php.ini

I also put the above "imagick.ini" file in /etc/opt/rh/rh-php72/php.d as well as the line at the end of /home/USER/etc/php7.2.

However, none of this results in any meaningful output about Imagemagick (or imagick) from phpinfo():

Inside Virtualmin at Server Configuration -> Website Options I see imagick under PHP 5.4.16, but not 7.2. I have restarted Apache multiple times each time I made a change.

"" is on the system:

[root@test php7.2]# locate
[root@test php7.2]#

The test machine is a GPL installation (installed moments ago), but I'm using that to test the installation before doing it on my Pro production installation. However, I doubt that's a material difference.

Anything I'm doing wrong here?



Closed (fixed)


Howdy -- thanks for contacting us!

There's a way to get pecl to look at the alternate PHP versions, though I don't know the exact syntax needed to make that work.

However, where I'd probably start is seeing if you have an RPM available. For example, on our server, we installed PHP 7.2 from the SCL repo. When I run "yum search magick", I see this result:


Which would be the PHP imagick plugin for PHP 7.2... if that or a similar package shows up for you, you may want to try installing that rather than using pecl.

Yes, I get that among the results too, although I don't think the SCL repo is among the ones on my system so it must be from somewhere else; maybe centos-sclo-rh or centos-sclo-sclo (which I guess could be the "SCL repo")?

OK, so just install sclo-php72-php-pecl-imagick.x86_64 using yum and that's it? Somehow I doubt that I won't have to do anything else.

Yup, it should just be a matter of running "yum install sclo-php72-php-pecl-imagick.x86_64".

That will add it to the global PHP config by default.

If that doesn't work, by all means let us know, but in theory you shouldn't have to do anything else.

Well, I was sceptical that it would be that simple, but you appear to be correct. Sorry for doubting you. Thanks!

It's no trouble at all, and I'm glad to hear that worked!

Feel free to let us know if you have any additional questions!