
Installing Imagick on cPanel CentOS 7
The ImageMagick toolkit allows users to display, create, convert, modify, and edit raster images for free and is openly available on multiple platforms.
To install imagick we must first access the server over SSH:
ssh root@server-ip
Next, run the following command to install the imagick service:
yum install ImageMagick ImageMagick-devel
Finally, we need to install the imagick PHP module to allow our websites or applications to connect with it.
Since cPanel now has a PHP Selector, this command will install the imagick PHP module for every installed PHP version:
for phpver in $(whmapi1 php_get_installed_versions|grep -oE '\bea-php.*') ; do
/opt/cpanel/"$phpver"/root/usr/bin/pecl install imagick
done
/scripts/restartsrv_httpd
/scripts/restartsrv_apache_php_fpm
Here is an example of the output.
Hit enter when asked:
Please provide the prefix of ImageMagick installation [autodetect] :
Starting to download imagick-3.5.1.tgz (301,411 bytes)
.............................................................done: 301,411 bytes
33 source files, building
running: phpize
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
Please provide the prefix of ImageMagick installation [autodetect] :
That’s it!
If you like, you can now check what PHP modules are loaded using a phpinfo.php
file. Here’s how: How to create a phpinfo file