View all posts

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

Related Articles...

How to sync server time

How to sync server time in CentOS & AlmaLinux

The NTP protocol synchronises the clocks of computers over a network. In this article, we will show you how to quickly sync the server time. Many systems-related tasks and processes require the correct timezone. For example, the cron daemon uses... Read more

This website uses cookies

We use cookies for the analysis of our visitor data, to improve our website, and to give you a great website experience. For more information about the cookies we use, please see our cookie policy.