How to install imagick with WHM

Background

At times WHM hosted WordPress sites may complain when checking security.

“Some modules are not installed”

The list typically looks like this:

  • exif
  • fileinfo
  • imagick
  • intl

Numbers 1,2, and 4 are easy to install with EasyApache 4 on a WHM server.

The problem is imagick simply doesn’t appear on the list. So what now?

There are two ways to do this, and two operating systems to consider as of 2023.

  1. AlmaLinux
  2. Ubuntu

AlmaLinux

The information for AlmaLinux can be found in this article, but for the busy administrator we’ve just extracted the actual commands.

dnf config-manager --set-enabled epel
dnf install ImageMagick ImageMagick-devel -y
find /opt/cpanel/ -iname pecl | grep bin
/opt/cpanel/ea-php74/root/usr/bin/pecl install imagick
/opt/cpanel/ea-php80/root/usr/bin/pecl install imagick
/opt/cpanel/ea-php81/root/usr/bin/pecl install imagick

Ubuntu

For Ubuntu we’ve copied some information from above article verbatim

EA-PHP Extension via WHM

  1. Log in to WHM as the root user.
  2. Navigate to “Home » Software » Module Installers”
  3. Click on the Manage link to the right of “PHP Pecl.
  4. Select your desired version of PHP from the drop-down menu, and click “Apply.
  5. Under “Install a PHP Pecl,” enter “imagick” (without the quotes).
  6. Click “Install Now.
  7. If the server’s operating system is CloudLinux, update CageFS by navigating to: “Home » Plugins » CageFS User Manager”
  8. Then click on the “Update CageFS Skeleton” button on the bottom right
  9. If PHP-FPM is used this service must also be restarted
    /scripts/restartsrv_apache_php_fpm

Good luck! May your WordPress instances always be happy.

Share this article

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top