Centos 7.6 removes imagick

Tom McIntyre

Active member
Our in-house server is running cPanel/WHM and iMagick was uninstalled when it upgraded last night.

I think I need to use yum to load the packages which appear to include pear as well as php-imagick, etc.

The yum.conf file has php* in its exclude directory and I am getting in over my head on this.

Has anyone else been through this and can describe what to do in this situation? I can access the machine but my linux is not a strong point at the shell level. I can edit files in a pinch, but prefer not to.

We first noted the problem this morning when one of our admins was trying to rotate some attachments using AndyB's rotate image addon on our xF1.5 installation. It is interesting to note that creating thumbnails for attachments was not affected even though our settings include image magick.

We will be upgrading our site to xF1.2 in the next month or so after 15 months of sorting out other issues in our organization. I will renew our support license when we are ready to proceed.
 
you can install imagick right through the pecl area in whm. don't mess with yum if you don't need to/don't know what you're doing.

software / module installers / php pecl
select your php version (this is likely why it went away, it was only installed for down-version ea-phpxxx)

search for it and then click install

imagick.png
 
If the PECL page tells you it's already installed, use the option to reinstall.

If that fails, install from Terminal in WHM:

First, install prerequisite php-pear, php-devel and gcc packages to compile the Imagick PHP extension.

yum install php-pear php-devel gcc

Now install ImageMagick software for PHP and Perl support:

yum install ImageMagick ImageMagick-devel ImageMagick-perl pcre-devel

Next, verify that ImageMagick has been installed on your system by checking its version.

convert --version

Manually install the Imagick PECL module for a specific PHP version (edit ea-php74 to ea-php73 or whatever php version you're using):

/opt/cpanel/ea-php74/root/usr/bin/pecl channel-update pecl.php.net /opt/cpanel/ea-php74/root/usr/bin/pecl install imagick

Restart Apache from WHM.

That should do it.
 
Last edited:
I think the yum.config file prevents it being installed. I should have said that php* was in the exclude "directive" in my first post.

That blocks php-pecl and all other php* packages. I can edit the file and remove the php* but I do not know why Centos is blocking php libraries.
 
I apologize for being a bit rattled here when I first posted. Here is a screen shot of our WHM.
centos7-8whm.webp
You can see we are running 7.8 and that php-pecl is not available in the Software menu. I opened the perl installer to show that it is working.
I think the next step is probably to do the reboot. This is our live system and I am concerned it might not come back up.

Below is the contents of the /etc/yum.conf file. Note the exclusion of PHP*

Code:
[root@mb2 etc]# cat yum.conf
[main]
exclude=courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* nsd* p0f php* proftpd* pure-ftpd* spamassassin* squirrelmail*
tolerant=1
errorlevel=1
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release


#  This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
#  It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
[root@mb2 etc]#
 
The system rebooted without problems but the imagick error persists.
Code:
Fatal error: Class 'Imagick' not found in /home/aname/public_html/library/Andy/Resize/ControllerPublic/Post.php on line 139
 
Thank you both so much. I am embarrassed that it took that long to soak into my skull. I missed the reference to the software tab and did not realize that the WHM interface would open a sub dialog to address the search for the module.

Maybe by the time we upgrade to XF2 I will be able to follow the logic of this system.
 
Just ran an update this morning and wondered why image handling was playing up !
Thanks for the confirmation and details
 
the takeaway is that every version of php has it's own modules.
anytime you upgrade php, you need to re-install the stuff like imagick, xcache/zendoptimizer (if you still use it)/redis/etc
 
My blind spot was that I did not expect a WHM/cPanel Centos release to not account for all the "common" modules. I only look at WHM once or twice a year.
 
Top Bottom