{"id":12793,"date":"2019-03-28T20:31:57","date_gmt":"2019-03-28T20:31:57","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=12793"},"modified":"2019-03-28T20:31:57","modified_gmt":"2019-03-28T20:31:57","slug":"install-imagemagick-image-manipulation-tool-on-rhel-centos-and-fedora","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/28\/install-imagemagick-image-manipulation-tool-on-rhel-centos-and-fedora\/","title":{"rendered":"Install ImageMagick (Image Manipulation) Tool on RHEL\/CentOS and Fedora"},"content":{"rendered":"<p><strong>ImageMagick<\/strong>\u00a0is a free open source simple software suite for any kind of image manipulation that is used for creating, editing, converting, displaying image files.<\/p>\n<p>It can able to read and write over 200 image files such as JPEG, GIF, PNG, TIFF, and Photo CD image formats and it is also used for thumbnail or captcha generation. It also includes command line options for<a href=\"https:\/\/www.tecmint.com\/terminalizer-record-your-linux-terminal-in-gif\/\" target=\"_blank\" rel=\"noopener\">\u00a0creating transparent or animated gif image formats<\/a>\u00a0and many more feature like resize, sharpen, rotate or add special effects to an image.<\/p>\n<p>To use\u00a0<strong>ImageMagick<\/strong>\u00a0tool with\u00a0<strong>PHP<\/strong>\u00a0or\u00a0<strong>Perl<\/strong>\u00a0programming language, you will need to install\u00a0<strong>ImageMagick<\/strong>\u00a0with\u00a0<strong>Imagick PHP<\/strong>\u00a0extension for\u00a0<strong>PHP<\/strong>\u00a0and\u00a0<strong>ImageMagick-Perl<\/strong>\u00a0extension for\u00a0<strong>Perl<\/strong>.<\/p>\n<p><strong>Imagick<\/strong>\u00a0is a simple PHP extension for creating and modifying images using the\u00a0<strong>ImageMagick API<\/strong>\u00a0program. There is a confusion in name, as people think that\u00a0<strong>ImageMagick<\/strong>\u00a0and\u00a0<strong>Imagick<\/strong>\u00a0both are same, but you can use\u00a0<strong>ImageMagick<\/strong>\u00a0without\u00a0<strong>Imagick<\/strong>\u00a0extension but you need both installed on your machine to use and run it.<\/p>\n<h3>Installing ImageMagick from Repository<\/h3>\n<p>First, install following prerequisite\u00a0<strong>php-pear<\/strong>,\u00a0<strong>php-devel<\/strong>\u00a0and\u00a0<strong>gcc<\/strong>\u00a0packages to compile imagick PHP extension.<\/p>\n<pre># yum install php-pear php-devel gcc \r\n<\/pre>\n<p>Once you\u2019ve installed\u00a0<strong>php-pear<\/strong>,\u00a0<strong>php-devel<\/strong>\u00a0and\u00a0<strong>gcc<\/strong>\u00a0packages, you may now install\u00a0<strong>ImageMagick<\/strong>\u00a0software for\u00a0<strong>PHP<\/strong>\u00a0and\u00a0<strong>Perl<\/strong>\u00a0support using\u00a0<a href=\"https:\/\/www.tecmint.com\/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement\/\" target=\"_blank\" rel=\"noopener\">yum command<\/a>.<\/p>\n<pre># yum install ImageMagick ImageMagick-devel ImageMagick-perl\r\n<\/pre>\n<p>Next, verify that\u00a0<strong>ImageMagick<\/strong>\u00a0has been installed on your system by checking its version.<\/p>\n<pre><strong># convert --version<\/strong>\r\n \r\nVersion: <strong>ImageMagick 6.7.8-9 2019-02-01 Q16 http:\/\/www.imagemagick.org<\/strong>\r\nCopyright: Copyright (C) 1999-2012 ImageMagick Studio LLC\r\nFeatures: OpenMP    \r\n<\/pre>\n<h3>Installing ImageMagick 7 from Source Code<\/h3>\n<p>To install ImageMagick from source, you need a proper development environment with a compiler and related development tools. If you don\u2019t have the required packages on your system, install development tools as shown:<\/p>\n<pre># yum groupinstall 'Development Tools'\r\n# yum -y install 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\r\n<\/pre>\n<p>Now, download the latest version of ImageMagick source code using following\u00a0<a href=\"https:\/\/www.tecmint.com\/10-wget-command-examples-in-linux\/\" target=\"_blank\" rel=\"noopener\">wget command<\/a>\u00a0and extract it.<\/p>\n<pre># wget https:\/\/www.imagemagick.org\/download\/ImageMagick.tar.gz\r\n# tar xvzf ImageMagick.tar.gz<\/pre>\n<p>Configure and compile the ImageMagick source code. Depending on your server hardware specs, this may take some time to finish.<\/p>\n<pre># cd ImageMagick*\r\n# .\/configure\r\n# make\r\n# make install\r\n<\/pre>\n<p>Verify that the ImageMagick compile and install were successful.<\/p>\n<pre><strong># magick -version<\/strong>\r\n\r\nVersion: <strong>ImageMagick 7.0.8-28 Q16 x86_64 2019-02-19 https:\/\/imagemagick.org<\/strong>\r\nCopyright: \u00a9 1999-2019 ImageMagick Studio LLC\r\nLicense: https:\/\/imagemagick.org\/script\/license.php\r\nFeatures: Cipher DPC HDRI OpenMP \r\nDelegates (built-in): bzlib djvu fontconfig freetype jng jpeg lzma openexr pangocairo png tiff wmf x xml zlib\r\n<\/pre>\n<h3>Install Imagick PHP Extension<\/h3>\n<p>Next, compile the imagick for\u00a0<strong>PHP<\/strong>\u00a0extension. To do, simple run the following \u2018<strong>pecl<\/strong>\u2018 command. It will install\u00a0<strong>ImageMagick<\/strong>\u00a0and\u00a0<strong>imagick PHP<\/strong>\u00a0extension module\u00a0<strong>\u2018imagick.so<\/strong>\u2018 under\u00a0<strong>\/usr\/lib\/php\/modules<\/strong>\u00a0directory. If you are using\u00a0<strong>64-bit<\/strong>\u00a0system, the module directory path would be\u00a0<strong>\/usr\/lib64\/php\/modules<\/strong>.<\/p>\n<pre><strong># pecl install imagick<\/strong> \r\n\r\ndownloading imagick-3.4.3.tgz ...\r\nStarting to download imagick-3.4.3.tgz (245,410 bytes)\r\n...................................................done: 245,410 bytes\r\n19 source files, building\r\nrunning: phpize\r\nConfiguring for:\r\nPHP Api Version:         20100412\r\nZend Module Api No:      20100525\r\nZend Extension Api No:   220100525\r\nPlease provide the prefix of Imagemagick installation [autodetect] : \r\n<\/pre>\n<p><strong>Note:<\/strong>\u00a0It will ask you to provide\u00a0<strong>Imagemagick<\/strong>\u00a0installation prefix, simply hit enter to auto detect.<\/p>\n<p>Now, add the \u2018<strong>imagick.so<\/strong>\u2018 extension to \u2018<strong>\/etc\/php.ini<\/strong>\u2018 file.<\/p>\n<pre>echo extension=imagick.so &gt;&gt; \/etc\/php.ini<\/pre>\n<p>Next, restart\u00a0<strong>Apache<\/strong>\u00a0web server.<\/p>\n<pre># service httpd restart<\/pre>\n<p>Verify imagick PHP extension by running the following command. You will see imagick extension similar to below.<\/p>\n<pre># php -m | grep imagick\r\n\r\nimagick<\/pre>\n<p>Alternatively, you can create a file called \u2018<strong>phpinfo.php<\/strong>\u2018 under website root directory (ex:\u00a0<strong>\/var\/www\/html\/<\/strong>).<\/p>\n<pre># vi \/var\/www\/html\/phpinfo.php<\/pre>\n<p>Add the following code.<\/p>\n<pre>&lt;?php\r\n\r\n     phpinfo ();\r\n?&gt;<\/pre>\n<p>Open your favorite web browser and type\u00a0<strong>\u2018http:\/\/localhost\/phpinfo.php<\/strong>\u2018 or \u2018<strong>http:\/\/ip-addresss\/phpinfo.php<\/strong>\u2018 and verify the imagick extension.<\/p>\n<div id=\"attachment_31945\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/04\/Check-Imagick-Version.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-31945\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2013\/04\/Check-Imagick-Version.png\" alt=\"Check Imagick Version\" width=\"669\" height=\"702\" aria-describedby=\"caption-attachment-31945\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-31945\" class=\"wp-caption-text\">Check Imagick Version<\/p>\n<p><a style=\"font-size: 1rem;\" href=\"https:\/\/www.tecmint.com\/install-imagemagick-in-linux\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>ImageMagick\u00a0is a free open source simple software suite for any kind of image manipulation that is used for creating, editing, converting, displaying image files. It can able to read and write over 200 image files such as JPEG, GIF, PNG, TIFF, and Photo CD image formats and it is also used for thumbnail or captcha &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/28\/install-imagemagick-image-manipulation-tool-on-rhel-centos-and-fedora\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Install ImageMagick (Image Manipulation) Tool on RHEL\/CentOS and Fedora&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-12793","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12793","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=12793"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12793\/revisions"}],"predecessor-version":[{"id":12794,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12793\/revisions\/12794"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=12793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=12793"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=12793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}