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:
- Image Resizing & Scaling
- Image Format Conversion
- 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
- Navigate to Home » Software » Module Installers
- Click Manage next to PHP PECL
- Select the desired PHP version from the drop-down
- Click Apply to confirm
- In the “Install a PHP Pecl” box, type imagick
- Click Install Now
Step 5: Update CageFS (If Installed)
If you’re using CageFS:
- Go to Home » Plugins » CageFS
- Click Update CageFS Skeleton
Step 6: Restart PHP-FPM (If Installed)
- Go to Home » Restart Services » PHP-FPM service for Apache
- 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.