+44 151 528 8706 [email protected]

How to install Imagemagick and imagick PHP extension

This is a quick guide on how to install both the imagick PHP extension as well as the application via SSH.

What is Imagemagick?

ImageMagick is a free and open-source cross-platform software suite for displaying, creating, converting, modifying, and editing raster images. Created in 1987 by John Cristy, it can read and write over 200 image file formats. It and its components are widely used in open-source applications.

What is Imagick?

Imagick is a native php extension to create and modify images using the ImageMagick API.
The name causes some confusion as people think that ImageMagick and Imagick are the same thing. You can use ImageMagick without Imagick but you need both Imagick and ImageMagick installed to run it.

1. Installing imagemagick:

yum -y install ImageMagick-devel ImageMagick-c++-devel ImageMagick-perl

2. Installing the imagemagick PHP extensions for all installed PHP versions.

for phpver in $(whmapi1 php_get_installed_versions|grep -oE ‘\bea-php.*’) ; do
printf “\autodetect” | /opt/cpanel/$phpver/root/usr/bin/pecl install imagick
echo ‘extension=imagick.so’ >> /opt/cpanel/$phpver/root/etc/php.d/imagick.ini
done
/scripts/restartsrv_httpd
/scripts/restartsrv_apache_php_fpm

3.  Test to make sure imagemagick is installed:

/usr/bin/convert –version

4. Test to make sure the PHP extensions loaded:

for phpver in $(whmapi1 php_get_installed_versions|grep -oE ‘\bea-php.*’) ; do
echo “PHP $phpver” ; /opt/cpanel/$phpver/root/usr/bin/php -m |grep imagick
done

Output should be:

PHP 54
imagick
PHP 55
imagick
PHP 56
imagick
PHP 70
imagick
PHP 71
imagick
PHP 72
imagick
PHP 73
imagick
PHP 74
imagick
PHP 80
imagick

Need Help managing your server? [We are available 24/7]

How to Mount an NFS Share in Linux

Network File System (NFS) is a distributed file system protocol that allows you to share remote directories over a network. With NFS, you can mount...

How to install Plesk on CentOS

Plesk is a commercial web hosting and server data center automation software with a control panel developed for Linux and Windows-based retail hosting...

Plesk vs cPanel

When choosing between web hosting control panels, it’s often a toss-up between Plesk or cPanel. Between them, they dominate the market for users looking for account and server...

We're Here To Help!

11 + 3 =

Head Office

Ukshin Kovaçica, 10,000 Pristina, Republic of Kosovo

Call Us

+44 151 528 8706