If you are a cPanel/WHM server administrator and want to enhance the image processing capabilities of your server, you may want to consider installing Imagick. Imagick is a PHP extension that enables image manipulation tasks, including resizing, cropping, and converting images to various formats.
Here is a step-by-step guide on how to install and enable Imagick on WHM/cPanel.
Step 1: Connect to your server via SSH
To install Imagick, you need to log in to your server via SSH as the root user or as a user with root privileges.
Step 2: Install the Imagick PHP Extension
To install the Imagick PHP extension, run the following command in your terminal:
yum install ImageMagick ImageMagick-devel -y
pecl install imagick
This command will install the necessary ImageMagick libraries and the Imagick PHP extension.
Step 3: Enable the Imagick PHP Extension
To enable the Imagick PHP extension, you need to add the following line to your php.ini file:
extension=imagick.so
You can find your php.ini file in the following directories:
- /usr/local/lib/php.ini
- /usr/local/cpanel/3rdparty/etc/php.ini
Step 4: Restart Apache
After enabling the Imagick PHP extension, you need to restart Apache for the changes to take effect. You can do this by running the following command:
service httpd restart
Step 5: Verify the Installation
To verify that Imagick is installed and enabled on your server, you can create a PHP info file and check the output.
Create a new file called phpinfo.php in your public_html directory and add the following code:
<?php phpinfo(); ?>
Save the file and access it via your web browser (http://yourdomain.com/phpinfo.php). Look for the Imagick section in the output. If you see it, then the installation was successful.
In conclusion, installing and enabling Imagick on your WHM/cPanel server is a straightforward process that can enhance your server’s image processing capabilities. By following the steps outlined in this guide, you should be able to install and enable Imagick without any issues.
Hosting maintenance note
Imagick changes WordPress media behavior, so the important proof is not only that the module loads. Upload a safe test image, regenerate a thumbnail if needed, and confirm the target site uses the PHP version where the extension is active.
Before changing a live site or server, capture the current configuration, confirm recent backups, and decide how you will roll back if the change affects logins, checkout, forms, cron jobs, or customer traffic. For shared hosting, make changes during a window where you can watch logs and customer-facing pages.
Post-change verification
- Validate the server or application configuration before reloading services.
- Test the exact workflow the change was meant to improve.
- Clear only the cache layers needed for the test, then retest from the public edge.
- Review logs for warnings, permission errors, failed requests, or unexpected redirects.
Related hosting performance reading
- Current Redis WHM/cPanel install guide
- Current Memcached WHM/cPanel install guide
- Current Imagick WHM/cPanel guide
- Current Imagick Linux hosting guide
- WordPress performance optimization guide
- WordPress speed tips
- How To Install And Enable redis For WHM/cPanel AlmaLinux 8
- How To Enable gzip With NGINX and Ubuntu 22.04