How To Install ImageMagick and PHP Imagick on CentOS 8 / RHEL 8 | Holhol24


ImageMagick is an open-source software suite for creating, editing, converting, and modifying bitmap images. With ImageMagick, you can read and write over 200 image formats, including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, and TIFF.

Apart from providing a graphical interface for working with images, it also provides commands to resize an image, blur, crop, draw on, flip, join, re-sample, and
much more.

PHP Imagick is a PHP extension by which you can call ImageMagick API to modify images.

Here, we will see how to install
ImageMagick and PHP Imagick on
CentOS 8 /

Enable EPEL Repository

ImageMagick packages are available in the EPEL repository for CentOS 8 / RHEL 8. So, follow the link to enable the EPEL repository.

How To Enable EPEL repository on CentOS 8 / RHEL 8


Run the below commands to enable the EPEL repository.

### CentOS 8 ###

dnf install -y epel-release

dnf config-manager --set-enabled PowerTools

### RHEL 8 ###

dnf install -y

ARCH=$( /bin/arch )
subscription-manager repos --enable "codeready-builder-for-rhel-8-${ARCH}-rpms"

Install ImageMagick

Once you have enabled the EPEL repository, install ImageMagick with
dnf command.

dnf install -y ImageMagick ImageMagick-devel

Install PHP Imagick

PHP Imagick is a native PHP extension to create and modify bitmap images using the ImageMagick API.

Install PHP, PHP development, and PHP Pear, which helps to install and manage PHP extensions.

dnf install -y php php-devel php-pear make

Now, install PHP Imagick with pecl command.

pecl install imagick

Add the extension into the php.ini file.

echo "" > /etc/php.d/20-imagick.ini

Restart the Apache web service to take an effect of newly installed PHP extension.

systemctl restart httpd

Validate PHP Imagick

List the complied modules to see if PHP Imagick is installed and available.

php -m

.    .    .
.    .    .


.    .    .
.    .    .

Additionally, you can check the PHP modules details from PHPInfo.

PHP Imagick Extension


That’s All. I hope you have learned how to install
ImageMagick and PHP Imagick on
CentOS 8 /

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More