Image processing is a critical feature for many modern web applications, whether it’s for resizing user-uploaded photos, converting formats, or optimizing image quality. One of the most powerful tools available for these tasks is ImageMagick, and its PHP extension, Imagick, allows seamless integration into PHP environments.

What is Imagick?

Imagick is a PHP extension that acts as a native interface to the ImageMagick library. ImageMagick itself is a robust, open-source software suite designed for creating, editing, converting, and manipulating image files in a variety of formats—including PNG, JPEG, GIF, TIFF, PDF, SVG, and more.

Common Use Cases:

  1. Image Resizing & Scaling

  2. Image Format Conversion

  3. Image Compression & Optimization

How to Install Imagick for EA-PHP

Follow the steps below to install Imagick on a server running EA-PHP, suitable for environments like cPanel/WHM.

Step 1: Access Server Command Line

Log in to your server as the root user via SSH or use the Terminal feature in WHM.

Step 2: Install ImageMagick via OS Package Manager

For CentOS 7 / CloudLinux 7:

yum install ImageMagick ImageMagick-devel -y

For AlmaLinux 8/9, CloudLinux 8/9, Rocky Linux 8/9:

dnf config-manager –set-enabled epel

dnf install ImageMagick ImageMagick-devel -y

For Ubuntu:

apt install imagemagick libmagickwand-dev

Step 3: Log in to WHM

Use your root credentials to log in to WHM.

Step 4: Install Imagick via PHP PECL Module Installer

  1. Navigate to Home » Software » Module Installers
  2. Click Manage next to PHP PECL
  3. Select the desired PHP version from the drop-down
  4. Click Apply to confirm
  5. In the “Install a PHP Pecl” box, type imagick
  6. Click Install Now

Step 5: Update CageFS (If Installed)

If you’re using CageFS:

  1. Go to Home » Plugins » CageFS
  2. Click Update CageFS Skeleton

Step 6: Restart PHP-FPM (If Installed)

  1. Go to Home » Restart Services » PHP-FPM service for Apache
  2. Click Restart

Conclusion

That’s it! You’ve successfully installed Imagick for EA-PHP. With this setup, your PHP applications can now harness the full power of ImageMagick for advanced image manipulation tasks.

If you need expert assistance with server configurations, PHP extensions, or performance tuning, the ServerAdminz team is always ready to help. Optimize. Secure. Scale — with ServerAdminz.