CentOS / Linux · August 9, 2018 1

Install ImageMagick/Imagick extension on EasyApache4 multi-php environment on CentOS

EasyApache4 supports multiple versions of php, if you want to install extensions for specific php version it might be hard to associate correct php extension, to resolve that issue we need SSH root login to use required php version when installing specific extension.

WHM doesn’t support some extensions in Easyapache4 like Imagick so you have to ssh root login to install it.

First Install ImageMagick and ImageMagic-devel RPM from WHM
WHM-Install-ImageMagick-RPM

If can’t find there then install it using root ssh
You can find the link in WHM > Install RPM

ssh root@server

If ImageMagick was not already installed, install it

# yum install -y ImageMagick ImageMagick-devel

Install the php imagick extension which is kind of bridge between ImageMagick and PHP, please use specific version of php if you have multi-php environment i.e EasyApache4
I am installing imagick extension for PHP-5.6

# /opt/cpanel/ea-php56/root/usr/bin/pecl install imagick

After installing php imagick extension you need to edit php.ini

# vi /opt/cpanel/ea-php56/root/etc/php.ini

Add a line for imagick extension

extension=imagick.so

Restart apache server

# service httpd restart

Verify if the extension was correctly installed.

# /opt/cpanel/ea-php56/root/usr/bin/php -m | grep imagick

If you see imagick as output that means imagick was successfully installed.