How to Install ImageMagick (Imagick) Extension on RHEL / Centos 7

Published on March 25, 2020 39 sec read

In this article, I’m going to show how to install the Imagick PHP extension on RHEL/CentOS 7. Let’s get started:

Table of Contents

  1. Install Support Repositories
  2. Install Imagick
  3. Check Imagick

Install Support Repositories

The imagick is available on the REMI repository. So, we need to install this repository:

sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

There is another popular repo call EPEL. You can try without EPEL. If some packages don’t find, then install EPEL:

sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Install Imagick

We need to install php-pear, php-devel and gcc packages to compile imagick PHP extension:

sudo yum install php-pear php-devel gcc

After installing the prerequisites, run this command to install Imagick:

sudo yum install php-pecl-imagick

Then go to /etc/php.d folder and search for imagick.ini file. You may find the file like 20-imagick.ini or 40-imagick.ini. After finding the file, run this command:

# replace imagick.ini with your own filename.
echo "extension=imagick.so" > /etc/php.d/imagick.ini

Check Imagick

Let’s try to find Imagick in phpinfo():

That’s all. Thank you. 🙂

Author

Hey, I'm Md Obydullah. I build open-source projects and write on Laravel, Linux server, modern JavaScript and more on web development.

Follow

Leave a Reply

Your email address will not be published. Required fields are marked *