Symptoms
Attempting to install Imagick failed with the below error:
/opt/cpanel/ea-php74/root/usr/bin/pecl install imagick
downloading imagick-3.4.4.tgz ...
Starting to download imagick-3.4.4.tgz (253,434 bytes)
.....................................................done: 253,434 bytes
19 source files, building
running: phpize
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
Can't locate Data/Dumper.pm in @INC (@INC contains:
/opt/rh/autotools-latest/root/usr/share/autoconf /usr/local/lib64/perl5
/usr/local/share/perl5 /usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib64/perl5 /usr/share/perl5 .) at
/opt/rh/autotools-latest/root/usr/share/autoconf/Autom4te/C4che.pm
line 33.
BEGIN failed--compilation aborted at
/opt/rh/autotools-latest/root/usr/share/autoconf/Autom4te/C4che.pm
line 33.
Compilation failed in require at
/opt/rh/autotools-latest/root/usr/bin/autom4te line 37.
BEGIN failed--compilation aborted at
/opt/rh/autotools-latest/root/usr/bin/autom4te line 37.
ERROR: `phpize' failed
Description
Installing Imagick requires a Perl package named perl-Data-Dumper. This package is usually installed by default unless Perl updates are excluded from the system updates. When the RPM package is missing, the installation will fail.
Workaround
Ensure Perl updates are not excluded in the "yum.conf" file.
grep perl /etc/yum.conf
exclude=bind-chroot courier* dovecot* exim* filesystem httpd* mod_ssl*
mydns* nsd* p0f perl* php* proftpd* pure-ftpd* spamassassin* squirrelmail*
Edit the file with a text editor like vi, vim, or nano to remove "perl*". Then Install the missing package.
yum install perl-Data-Dumper
Afterward, try installing Imagick once more.
/opt/cpanel/ea-php74/root/usr/bin/pecl install imagick