2 methods to install ImageMagick extension on CentOS 6

888u

Last update at :2024-06-23,Edit by888u

ImageMagick is a software suite for creating, editing, compositing, or converting bitmap images. We can use it to read and write images in various formats, including DPX, EXR, GIF, JPEG, PDF, SVG and TIFF. We can use the ImageMagick component to resize, flip, mirror, rotate, twist, shear and convert images, adjust image color, and apply various special effects, or draw text, lines, surfaces, ellipses and Bezier curves .

ImageMagick can be installed by using the Remi installation repository, or by compiling from the latest stable version from source. Below, Snail has compiled tutorials from abroad, divided into different installation methods.

Method one, install the ImageMagick extension from the installation library

A – If we have not installed the EPEL library, we need to install it first

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmrpm -Uvh epel-release-6*.rpm

B - Install Remi library

wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpmrpm -Uvh remi-release-6*.rpm

C - Edit /etc/yum.repos.d/remi.repo file startup

We need to find the Remi library and change enabled=0 to enabled=1

D - Install the required dependency package environment

yum install -y gcc php-devel php-pear

E - Install ImageMagick

yum install -y ImageMagick ImageMagick-devel

After the installation is completed, we see this prompt indicating that the installation was successful.

Method 2: Install ImageMagick from source code

A - Install dependent package environment

yum -y groupinstall \\'Development Tools\\'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

B - Get the installation source

wget http://www.imagemagick.org/download/ImageMagick.tar.gztar xvzf ImageMagick.tar.gzcd ImageMagick*

C – Configuring and compiling source code

./configuremakemake install

This will take a while, we'll wait.

D - Verify whether the installation is successful

convert –version

E - Install PHP extension

pecl install imagick

If there is an error -bash: pecl: command not found, we need to run yum install php-devel php-pear httpd-devel environment package first, and then perform the above step.

F – php.ini add extension=imagick.so

After pressing Enter to execute, we can see the prompt that we need to add extension=imagick.so to PHP.INI. Just add it to the /etc/php.ini file.

G -Then check whether the installation is successful

php -m | grep imagick

We can see it's OK. If you are running a web server such as Apache, remember to restart.

service httpd restart

Recommended site search: IP server replacement in seconds, Google permanently free server, vps foreign server, server abroad, US virtual host purchase, domain name purchase domain name space, Guangzhou server rental, registered domain name, registration-free space,

2 methods to install ImageMagick extension on CentOS 6

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码