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.