Virtualmin Configuration: Adding Image Magick to PHP 5.6.5

Tonight I needed to do some work on my Other Blog and noticed that I was unable to edit images directly in WordPress. Yep, I hadn’t installed Image Magick yet and so those functions were not available. If you followed the installation/configuration instructions at my Previous Post, then the following likely applies to you. And it might apply to you anyway. I knew it was just a PECL install away, but I forgot to install Imagick first, and so I got the error “checking Testing /usr/local/bin/MagickWand-config… Doesn’t exist”. If you follow the steps below, it’ll fix it right up.

I’ve distilled it into a few simple steps:

1: Install Image Magick and needed libraries:

yum install ImageMagick-Devel ImageMagick

Now you’re ready to install the PHP PECL library.

2: Install imagick via PECL:

/opt/rh/rh-php56/root/bin/pecl install imagick

3: Enable it in your php.ini

echo "extension=imagick.so" >> /home/username/etc/php5.6/php.ini

4: Restart Apache

systemctl restart httpd

That should do it! Use a phpinfo() to check to make sure the module is there, and you’re good to go!

2 comments

  1. Thanks for the tip mate, especially as I tend to get confused due to multiple PHP versions running concurrently on Virtualmin for some reason, and one of the developers mentioned that there’s practically no way you could set the secondary PHP runtime as the commandline default or something.

    1. Hey there, you may appreciate a more updated version of this. I’ve got 4 versions (and you could add 5.5…) and it works great. I distilled it in this document on github, where I also show how to use any version you want as the default PHP at the CLI.

      https://github.com/corneliusroot/Virtualmin/blob/master/PHP%205.4%2C%205.6%2C%207.0%2C%207.1%20Installation%20Instructions

Leave a Reply

Your email address will not be published.

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