How to Install ImageMagick Extension on EasyApache4?
By Jithin on November 19th, 2018
The Imagick is a php extension which covers all the methods of the Imagick class which how to modify pixel based images. The Imagick PHP extension does not exist in easy apache4 by default. To know more about ImageMagick and the components you can refer the following.
In this tutorial, we are going to install ImageMagick on centos 7 servers with cPanel as a control panel. ImageMagick can be installed on any PHP version individually.
1) Log in to your server via SSH.
2) Now you have logged into your server first we need to check to ensure ImageMagick and ImageMagick-devel packages are installed on the system. You can run the following command to install the same.
yum install ImageMagick ImageMagick-devel pcre-devel
3) First, you should make sure which php version that your website is using, for that please create a php.info page in the document root of the website and call the site along with php.info (eq: http://domain.com/info.php)
Steps to create php.info file is mentioned below
Go to the document root of the website. Then create a file using the following command
Add this line to this file
<? phpinfo(); ?>
Press esc key on the keyboard and type the following command then enter so that the file will be saved:
Change the ownership of info.php to the corresponding username of the cPanel account
chown (username):(username) info.php
Now check the php version of your website by calling the domain along with info.php as mentioned in the following screen shot.
4) Now you can run any one of the following PECL command to install ImageMagick on the server based on the PHP version which your website is using.
/opt/cpanel/ea-php55/root/usr/bin/pecl install imagick For ea-php55
/opt/cpanel/ea-php56/root/usr/bin/pecl install imagick For ea-php56
/opt/cpanel/ea-php70/root/usr/bin/pecl install imagick For ea-php70
/opt/cpanel/ea-php71/root/usr/bin/pecl install imagick For ea-php71
/opt/cpanel/ea-php72/root/usr/bin/pecl install imagick For ea-php72
5) You can press the enter key to continue.
6) Now you have successfully installed Imagick. You can also verify the same from the php info page.
If you need any further help please do reach our support department.