Howto Install ImageMagick PHP extensions on your cPanel server

We will show you how to install and enable the ImageMagick PHP extensions for all versions of PHP installed on your server. This process can be done using the command line or through the WHM.

Install using the command line

Log into the command line of your server as the user root and run the following commands.

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

for php in $(whmapi1 php_get_installed_versions|grep -oE '\bea-php.*') ; do 
    /opt/cpanel/$php/root/usr/bin/pecl install imagick;
done

Install using the Web Host Manager

  1. Login to the WebHostManager as the user root.
  2. Click 'Module Installers' under the 'Software' section from the sidebar.
  3. Click 'Manage' next to 'PHP PECL'
  4. Select the PHP version from the dropdown that you would like to install ImageMagick on and click 'Apply'
  5. enter 'magick' into the search textbox and click 'Go'
  6. You should now see the 'magick (version)' in the search results, click the 'Install' link.

ImageMagick has now been installed for the PHP version you selected. Repeat these steps for each version of PHP you wish this module to be enabled on.