ImageMagick is a popular PHP extension used for image manipulation — resizing, converting formats, cropping, and more. Many CMS platforms, gallery plugins, and e-commerce applications require it. This guide walks you through installing ImageMagick on your WHM/cPanel server via the PHP PECL module installer.

Prerequisites

  • Root access to WHM.
  • WHM version 82 or later.
  • The PHP version you are targeting must have the PECL installer available (default in EasyApache 4).

Step 1: Log In to WHM

Log in to your WHM interface at https://your-server-hostname:2087 with your root credentials.

Step 2: Navigate to Module Installers

In the left-hand sidebar, go to Software » Module Installers.

Step 3: Open PHP PECL

On the Module Installers page, find PHP PECL and click the Manage button next to it.

Step 4: Search for ImageMagick

In the search box, type Imagick (with a capital "I") and click Go or press Enter.

Step 5: Install the Module

Find Imagick in the search results. Click Install under the Actions column. The installation process may take a few minutes to compile.

Step 6: Verify the Installation

After installation completes, verify that ImageMagick is loaded:

  • In WHM, go to Software » MultiPHP INI Editor, select the PHP version, and check that imagick appears in the loaded extensions.
  • Alternatively, create a PHP info file (phpinfo.php with <?php phpinfo(); ?>) in a domain's document root and check for an "imagick" section.

Important Notes

  • ImageMagick is installed per PHP version. If your server runs multiple PHP versions (e.g., 7.4, 8.0, 8.2), repeat the installation for each version that needs it.
  • Some applications may also require the Imagick PHP extension and the ImageMagick server-side binaries. WHM's PECL installer handles both.
  • After installing, you may need to rebuild Apache or restart PHP-FPM for the changes to take effect: go to WHM » Restart Services » HTTP Server (Apache) or PHP-FPM service.
  • If EasyApache processes are running, wait for them to complete before installing PECL modules.

Troubleshooting

  • "Imagick not found" in search results? Ensure you typed Imagick (capital "I", lowercase "magick"). Also confirm the PHP version you are using supports PECL.
  • Installation fails with compile errors? Your server may be missing required development libraries. Install them via SSH: yum install ImageMagick-devel (CentOS/AlmaLinux) or apt install libmagickwand-dev (Ubuntu), then retry.
  • Module shows as installed but doesn't work? Restart the PHP service via WHM » Restart Services » PHP-FPM service (or Apache if using mod_php). Also check the PHP error log for loading errors.
  • Need to uninstall? Return to the PHP PECL manager, search for Imagick, and click Uninstall.

For more details, see the official cPanel PHP PECL documentation.

Was this answer helpful? 0 Users Found This Useful (0 Votes)