Installing PHP extension imagick manually because it’s missing in cPanel/WHM EasyApache 4

We needed imagemagick installed on our server for nextCloud, but imagick is missing/unavailable in EasyApache 4.

Fortunately, we found the following instructions, which worked perfectly for us on our cPanel/WHM server for PHP versions 7.4, 8.0, and 8.1…

Original source:

Originally written by Justin Catello

This is fairly simple, just copy and paste the following into SSH.

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 '' >> /opt/cpanel/$phpver/root/etc/php.d/imagick.ini

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
PHP 54
PHP 55
PHP 56
PHP 70
PHP 71

Leave a Reply

Your email address will not be published.