ImageMagick PECL Install Issues on cPanel/WHM
Some server administrators encounter issues when attempting to install the PHP Imagick extension via PECL on cPanel/WHM servers. In many cases, the PECL installer fails or breaks existing ImageMagick functionality due to version mismatches, missing development libraries, or outdated packages.
The following discussion thread provides useful background information and troubleshooting from other cPanel users who faced similar issues:
http://forums.cpanel.net/f5/imagemagick-pecl-install-breaks-126257.html
Why the PECL Imagick Installer Fails
- Missing ImageMagick-devel libraries
- Outdated ImageMagick packages included with the OS
- Conflicts between system ImageMagick and EasyApache builds
- Incorrect PHP paths or multiple PHP versions installed
- Compiling Imagick before ImageMagick is fully installed
These issues commonly appear on older CentOS versions or servers still running EasyApache 3.
Recommended Fix
Instead of using PECL directly, install Imagick using the EasyApache 4 RPM packages, which are maintained by cPanel:
For PHP 7.4:
yum install ea-php74-php-pecl-imagick
For PHP 8.x:
yum install ea-php80-php-pecl-imagick
yum install ea-php81-php-pecl-imagick
yum install ea-php82-php-pecl-imagick
(Only install the versions you need.)
Make sure ImageMagick and ImageMagick-devel are installed first:
yum install ImageMagick ImageMagick-devel -y
Then restart Apache:
service httpd restart
Verification
Verify Imagick is installed:
php -m | grep imagick
Verify ImageMagick is working:
convert --version
Important Notes
- Do not install Imagick via PECL unless necessary; use EA4 RPMs instead.
- Always install ImageMagick-devel before Imagick.
- Old forum advice may apply only to outdated systems (CentOS 5/6, EasyApache 3).
- If Imagick breaks after PECL installation, remove it and reinstall using EA4.
The cPanel forum link remains useful for historical context and troubleshooting, but follow modern EA4 installation steps for stable results.