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

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

sudo yum install

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 "" > /etc/php.d/imagick.ini

Check Imagick

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

That’s all. Thank you. 🙂

Monthly Newsletter

One email a month, packed with the latest tutorials, delivered straight to your inbox.
We'll never send any spam or promotional emails.

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