Install ImageMagick (Image Manipulation) Tool on RHEL/CentOS and Fedora
0

ImageMagick is a free open supply easy software program suite for any form of picture manipulation that’s used for creating, enhancing, changing, displaying picture recordsdata.

It might capable of learn and write over 200 picture recordsdata resembling JPEG, GIF, PNG, TIFF, and Picture CD picture codecs and it’s also used for thumbnail or captcha era. It additionally consists of command line choices for creating clear or animated gif picture codecs and lots of extra function like resize, sharpen, rotate or add particular results to a picture.

To make use of ImageMagick software with PHP or Perl programming language, you’ll need to put in ImageMagick with Imagick PHP extension for PHP and ImageMagick-Perl extension for Perl.

Imagick is an easy PHP extension for creating and modifying photos utilizing the ImageMagick API program. There’s a confusion in title, as folks assume that ImageMagick and Imagick each are identical, however you need to use ImageMagick with out Imagick extension however you want each put in in your machine to make use of and run it.

Putting in ImageMagick from Repository

First, set up following prerequisite php-pear, php-devel and gcc packages to compile imagick PHP extension.

# yum set up php-pear php-devel gcc 
 

When you’ve put in php-pear, php-devel and gcc packages, you could now set up ImageMagick software program for PHP and Perl help utilizing yum command.

# yum set up ImageMagick ImageMagick-devel ImageMagick-perl
 

Subsequent, confirm that ImageMagick has been put in in your system by checking its model.

# convert --version
  
 Model: ImageMagick 6.7.8-9 2019-02-01 Q16 http://www.imagemagick.org
 Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
 Options: OpenMP    
 

Putting in ImageMagick 7 from Supply Code

To put in ImageMagick from supply, you want a correct improvement surroundings with a compiler and associated improvement instruments. If you happen to don’t have the required packages in your system, set up improvement instruments as proven:

# yum groupinstall 'Growth Instruments'
 # yum -y set up bzip2-devel freetype-devel libjpeg-devel libpng-devel libtiff-devel giflib-devel zlib-devel ghostscript-devel djvulibre-devel libwmf-devel jasper-devel libtool-ltdl-devel libX11-devel libXext-devel libXt-devel lcms-devel libxml2-devel librsvg2-devel OpenEXR-devel php-devel
 

Now, obtain the most recent model of ImageMagick supply code utilizing following wget command and extract it.

# wget https://www.imagemagick.org/download/ImageMagick.tar.gz
 # tar xvzf ImageMagick.tar.gz
 

Configure and compile the ImageMagick supply code. Relying in your server {hardware} specs, this may occasionally take a while to complete.

# cd ImageMagick*
 # ./configure
 # make
 # make set up
 

Confirm that the ImageMagick compile and set up had been profitable.

# magick -version
 
 Model: ImageMagick 7.0.8-28 Q16 x86_64 2019-02-19 https://imagemagick.org
 Copyright: © 1999-2019 ImageMagick Studio LLC
 License: https://imagemagick.org/script/license.php
 Options: Cipher DPC HDRI OpenMP 
 Delegates (built-in): bzlib djvu fontconfig freetype jng jpeg lzma openexr pangocairo png tiff wmf x xml zlib
 

Set up Imagick PHP Extension

Subsequent, compile the imagick for PHP extension. To do, easy run the next ‘pecl‘ command. It can set up ImageMagick and imagick PHP extension module ‘imagick.so‘ beneath /usr/lib/php/modules listing. In case you are utilizing 64-bit system, the module listing path could be /usr/lib64/php/modules.

# pecl set up imagick 
 
 downloading imagick-3.4.3.tgz ...
 Beginning to obtain imagick-3.4.3.tgz (245,410 bytes)
 ...................................................accomplished: 245,410 bytes
 19 supply recordsdata, constructing
 operating: phpize
 Configuring for:
 PHP Api Model:         20100412
 Zend Module Api No:      20100525
 Zend Extension Api No:   220100525
 Please present the prefix of Imagemagick set up [autodetect] : 
 

Observe: It can ask you to offer Imagemagick set up prefix, merely hit enter to auto detect.

Now, add the ‘imagick.so‘ extension to ‘/and many others/php.ini‘ file.

echo extension=imagick.so >> /and many others/php.ini

Subsequent, restart Apache internet server.

# service httpd restart

Confirm imagick PHP extension by operating the next command. You will notice imagick extension just like under.

# php -m | grep imagick
 
 imagick

Alternatively, you’ll be able to create a file known as ‘phpinfo.php‘ beneath web site root listing (ex: /var/www/html/).

# vi /var/www/html/phpinfo.php

Add the next code.

<?php
 
      phpinfo ();
 ?>

Open your favourite internet browser and sort ‘http://localhost/phpinfo.php‘ or ‘http://ip-addresss/phpinfo.php‘ and confirm the imagick extension.

Check Imagick Version

Test Imagick Model

 

Why Does Overclocking Void Your Guarantee?

Previous article

Learn how to Setup Kerberos Server and Shopper on Ubuntu 18.04 LTS

Next article

You may also like

Comments

Leave a Reply

More in Apache