Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794
{"id":2538,"date":"2019-12-06T14:14:01","date_gmt":"2019-12-06T14:14:01","guid":{"rendered":"https:\/\/support.aklwebhost.com\/?post_type=manual_kb&p=2538"},"modified":"2019-12-08T10:52:58","modified_gmt":"2019-12-08T10:52:58","slug":"install-imagemagick-on-centos-6","status":"publish","type":"manual_kb","link":"https:\/\/support.aklwebhost.com\/knowledgebase\/install-imagemagick-on-centos-6\/","title":{"rendered":"Install ImageMagick on CentOS 6"},"content":{"rendered":"

ImageMagick\u00ae is a software suite to create, edit, compose, or convert bitmap images.<\/strong>\u00a0It can read and write images in a variety of formats (over 100) including\u00a0DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PNG, Postscript, SVG, and TIFF.<\/strong>\u00a0Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and B\u00e9zier curves.<\/p>\n

ImageMagick can be installed<\/strong>\u00a0by either using the remi repository, or by compiling the source code from the latest stable release. Following the installation guide is another guide on how to install the ImageMagick PHP extension (imagick).<\/p>\n

Simple install from remi repository<\/strong><\/h3>\n

If you have not installed the\u00a0epel repository<\/strong>, install it now.<\/p>\n

wget http:\/\/dl.fedoraproject.org\/pub\/epel\/6\/x86_64\/epel-release-6-8.noarch.rpm\r\nrpm -Uvh epel-release-6*.rpm\r\n<\/code><\/pre>\n

Next, install the remi repository:<\/strong><\/p>\n

wget http:\/\/rpms.famillecollet.com\/enterprise\/remi-release-6.rpm\r\nrpm -Uvh remi-release-6*.rpm\r\n<\/code><\/pre>\n

An\u00a0additional step is required<\/strong>\u00a0to enable the remi repository:<\/p>\n

Use your favorite text editor to open\u00a0\/etc\/yum.repos.d\/remi.repo<\/code>. Look for the remi section and find\u00a0enabled=0<\/code>\u00a0and change it to\u00a0enabled=1<\/code>.<\/p>\n

Make sure that the\u00a0required dependencies<\/strong>\u00a0are installed:<\/p>\n

yum install -y gcc php-devel php-pear\r\n<\/code><\/pre>\n

Then install ImageMagick:<\/strong><\/p>\n

yum install -y ImageMagick ImageMagick-devel\r\n<\/code><\/pre>\n

Extra:<\/strong>\u00a0If you plan on using\u00a0ImageMagick<\/strong>\u00a0in perl scripts:<\/p>\n

yum install ImageMagick-perl\r\n<\/code><\/pre>\n

The installation is now complete.<\/strong><\/p>\n

Install from source code<\/strong><\/h3>\n

First install dependencies:<\/strong><\/p>\n

 yum -y 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<\/code><\/pre>\n

Now, fetch the source code:<\/strong><\/p>\n

wget http:\/\/www.imagemagick.org\/download\/ImageMagick.tar.gz\r\ntar xvzf ImageMagick.tar.gz\r\ncd ImageMagick*\r\n<\/code><\/pre>\n

Configure and compile the source code.<\/strong>\u00a0Depending on your server specs, this may take some time to complete.<\/p>\n

.\/configure\r\nmake\r\nmake install\r\n<\/code><\/pre>\n

Verify that the compile and install were successful:<\/strong><\/p>\n

convert --version \r\n<\/code><\/pre>\n

Install PHP extension<\/strong><\/h3>\n

Install the\u00a0imagick<\/code>\u00a0PHP extension module<\/strong>\u00a0imagick.so<\/code>:<\/p>\n

pecl install imagick\r\n<\/code><\/pre>\n

You will be asked to provide the\u00a0ImageMagick installation prefix<\/strong>. Press\u00a0[ENTER]<\/code>\u00a0to auto detect. You may get this error following the pecl command:<\/p>\n

\"Error shtool at '\/var\/tmp\/imagick\/build\/shtool' does not exist or is not executable. Make sure that the file exists and is executable and then rerun this script\"\r\n<\/code><\/pre>\n

This is due to a secured and mounted\u00a0\/tmp<\/code>\u00a0directory. You may have setup your\u00a0\/tmp<\/code>\u00a0folder in this way as part of your server security lock-down. To resolve this error temporarily, remove the\u00a0\/tmp<\/code>\u00a0line in\u00a0\/etc\/fstab<\/code>\u00a0and reboot. Run the pecl command again.\u00a0When installation completes<\/strong>, you can add the\u00a0\/tmp<\/code>\u00a0line back to\u00a0\/etc\/fstab<\/code>\u00a0and reboot. Using the\u00a0umount<\/code>\u00a0command will not work if\u00a0\/tmp<\/code>\u00a0has the\u00a0nosuid,noexec,nodev<\/code>\u00a0options.<\/p>\n

Next<\/strong>, add the\u00a0imagick.so<\/code>\u00a0extension to the\u00a0php.ini<\/code>\u00a0file.\u00a0Start by locating your<\/strong>\u00a0php.ini<\/code>\u00a0file. It is usually found in\u00a0\/etc<\/code>.<\/p>\n

php -i | grep \"Loaded Configuration File\"\r\n<\/code><\/pre>\n

Use a text editor to open\u00a0php.ini<\/code>\u00a0and look for the\u00a0dynamic extension<\/strong>\u00a0section. Add\u00a0extension=imagick.so<\/code>, then save.<\/p>\n

Check the\u00a0php extension list<\/strong>\u00a0to verify that imagick has installed correctly:<\/p>\n

php -m | grep imagick\r\n<\/code><\/pre>\n

If you are running a\u00a0webserver,<\/strong>\u00a0such as\u00a0Apache,<\/strong>\u00a0remember to restart it:<\/p>\n

service httpd restart\r\n<\/code><\/pre>\n

References<\/strong><\/h3>\n
    \n
  1. The official\u00a0ImageMagick<\/span><\/a><\/strong>\u00a0website.<\/li>\n<\/ol>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","manualknowledgebasecat":[231,242],"manual_kb_tag":[338],"_links":{"self":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2538"}],"collection":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/comments?post=2538"}],"version-history":[{"count":1,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2538\/revisions"}],"predecessor-version":[{"id":2539,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2538\/revisions\/2539"}],"wp:attachment":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/media?parent=2538"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manualknowledgebasecat?post=2538"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb_tag?post=2538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}