ImageMagick is an image processing library used by PHP applications including WordPress and Magento for resizing, converting and manipulating images. The Imagick PHP extension connects your PHP stack to ImageMagick so applications can process images programmatically.
You will install ImageMagick and enable the Imagick extension on your cPanel server. Two methods are covered: EasyApache 4, which is the recommended approach for cPanel servers, and a manual SSH compilation method for advanced cases.
EasyApache 4 is the standard package manager on cPanel servers. Installing ImageMagick and Imagick through it ensures both packages integrate with your PHP stack and persist correctly through future cPanel updates.
https://yourserver:2087, replacing yourserver with your server hostname or IP address.imagemagick. Locate ea-imagemagick and toggle it on.imagick in the extensions list and tick the checkbox next to it.php.ini for the selected version immediately.The Imagick extension is now active. Skip to the verification section to confirm the installation.
If you need to target a specific PHP version or EasyApache 4 is unavailable, you can compile Imagick from source via SSH. This uses EA-PHP’s own pecl and phpize binaries to ensure the extension links against the correct PHP build.
Connect to your server as root via SSH, then run the following commands, substituting ea-php83 for your target PHP version (for example, ea-php82 for PHP 8.2).
Download and extract the Imagick source:
/opt/cpanel/ea-php83/root/usr/bin/pecl download imagick
tar xvzf imagick-*.tgz
cd imagick-*
Set the pkg-config path so the build detects ImageMagick 7 correctly:
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
Prepare the build environment using EA-PHP’s phpize, then configure and compile:
/opt/cpanel/ea-php83/root/usr/bin/phpize
./configure --with-imagick=/usr/local --with-php-config=/opt/cpanel/ea-php83/root/usr/bin/php-config
make clean
make -j"$(nproc)"
make install
The compiled imagick.so is placed in /opt/cpanel/ea-php83/root/usr/lib64/php/modules/. Manually compiled extensions do not appear in MultiPHP Extensions Manager. To enable the extension, go to WHM → Software → MultiPHP INI Editor, switch to Editor Mode, select your PHP version, and add extension=imagick.so on a new line. Alternatively, add it directly to the relevant php.ini file.
Run the following command via SSH to confirm Imagick is loaded for the PHP version you installed it against:
php -r "echo extension_loaded('imagick') ? 'Imagick loaded' : 'Imagick not found';"
If the output is Imagick loaded, the extension is working. If you see Imagick not found, check that the extension is enabled in MultiPHP Extensions Manager for the PHP version returned by php -v. You can also create a phpinfo file and search for imagick to confirm it appears in the extension list.
You installed ImageMagick on your cPanel server and enabled the PHP Imagick extension. PHP applications on your server can now use Imagick for image resizing, format conversion and thumbnail generation.
Test the applications that depend on Imagick to confirm they work correctly after installation. If you need to change the PHP version for a domain, you can do so without affecting the Imagick extension settings. For a fresh server setup, see our guide on how to install cPanel.
Our VPS hosting plans give you root access and full control over server-level software, including EasyApache 4 package management.
Get scalable resources with our VPS hosting with root access and optional software.
Get VPS HostingPerfect for websites and small businesses unlimited bandwidth with cPanel hosting.
Get cPanel Hosting