• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to install PHP ImageMagick on CentOS 7

{{postValue.id}}

To install PHP ImageMagick on CentOS 7

ImageMagick is a free and open-source software suite used for creating, editing, composing, or converting bitmap images. With ImageMagick, you can it is easy for you to read and write images in a variety of formats like GIF, JPEG, PNG, Postscript, and TIFF. You can also use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images and much more. It is really very easy to install ImageMagic and in this tutorial, you will learn about the method to install it on CentOS 7.

Installing ImageMagick

The installation of ImageMagick requires certain development tools, and to add them to your system, you need to run the following command, which installs them all together.

[root@linuxhelp ~]# yum groupinstall " Development Tools"  -y
Loaded plugins: fastestmirror, langpacks
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
base                                                     | 3.6 kB     00:00     
extras                                                   | 3.4 kB     00:00     
updates                                                  | 3.4 kB     00:00     
(1/4): base/7/x86_64/group_gz                              | 156 kB   00:01     
(2/4): extras/7/x86_64/primary_db                          | 129 kB   00:01     
(3/4): base/7/x86_64/primary_db                            | 5.7 MB   00:23     
(4/4): updates/7/x86_64/primary_db                         | 3.6 MB   00:29     
Loading mirror speeds from cached hostfile
 * base: centos.myfahim.com
 * extras: mirrors.viethosting.com
 * updates: mirrors.vonline.vn
.
.
.
Dependency Updated:
  boost-system.x86_64 0:1.53.0-27.el7     dyninst.x86_64 0:9.3.1-1.el7          
  gettext.x86_64 0:0.19.8.1-2.el7         gettext-libs.x86_64 0:0.19.8.1-2.el7  
  glibc.x86_64 0:2.17-196.el7             glibc-common.x86_64 0:2.17-196.el7    
  libgcc.x86_64 0:4.8.5-16.el7            libgomp.x86_64 0:4.8.5-16.el7         
  libstdc++.x86_64 0:4.8.5-16.el7         rpm.x86_64 0:4.11.3-25.el7            
  rpm-build-libs.x86_64 0:4.11.3-25.el7   rpm-libs.x86_64 0:4.11.3-25.el7       
  rpm-python.x86_64 0:4.11.3-25.el7       systemtap-runtime.x86_64 0:3.1-3.el7  

Complete!


Once the development tools are installed, you can can start the installation of ImageMagick by running the following command.

[root@linuxhelp ~]# yum install ImageMagick ImageMagick-devel -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.myfahim.com
 * extras: mirrors.viethosting.com
 * updates: mirrors.vonline.vn
Resolving Dependencies
-->  Running transaction check
--->  Package ImageMagick.x86_64 0:6.7.8.9-15.el7_2 will be installed
-->  Processing Dependency: libwmflite-0.2.so.7()(64bit) for package: ImageMagick-6.7.8.9-15.el7_2.x86_64
-->  Processing Dependency: libImath.so.6()(64bit) for package: ImageMagick-6.7.8.9-15.el7_2.x86_64
.
.
.
.
libX11.x86_64 0:1.6.5-1.el7                                                   
  libX11-common.noarch 0:1.6.5-1.el7                                            
  libXext.x86_64 0:1.3.3-3.el7                                                  
  libXt.x86_64 0:1.1.5-3.el7                                                    
  libtiff.x86_64 0:4.0.3-27.el7_3                                               
  libxcb.x86_64 0:1.12-1.el7                                                    
  zlib.x86_64 0:1.2.7-17.el7                                                    

Complete!


Also, it is required for you to install the php pear extension, so run the following command.

[root@linuxhelp ~]#  yum install php-pear
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.nhanhoa.com
 * extras: mirrors.nhanhoa.com
 * updates: centos-hn.viettelidc.com.vn
Resolving Dependencies
-->  Running transaction check
--->  Package php-pear.noarch 1:1.9.4-21.el7 will be installed
-->  Processing Dependency: php-zlib for package: 1:php-pear-1.9.4-21.el7.noarch
-->  Processing Dependency: php-xml for package: 1:php-pear-1.9.4-21.el7.noarch
-->  Processing Dependency: php-tokenizer for package: 1:php-pear-1.9.4-21.el7.noarch
-->  Processing Dependency: php-posix for package: 1:php-pear-1.9.4-21.el7.noarch
-->  Processing Dependency: php-pcre for package: 1:php-pear-1.9.4-21.el7.noarch
-->  Processing Dependency: php-ftp for package: 1:php-pear-1.9.4-21.el7.noarch
-->  Processing Dependency: php-cli for package: 1:php-pear-1.9.4-21.el7.noarch
-->  Processing Dependency: php-bz2 for package: 1:php-pear-1.9.4-21.el7.noarch
.
.
.
.
.

Installing : php-process-5.4.16-42.el7.x86_64                             5/6 
  Installing : 1:php-pear-1.9.4-21.el7.noarch                               6/6 
  Verifying  : php-cli-5.4.16-42.el7.x86_64                                 1/6 
  Verifying  : php-xml-5.4.16-42.el7.x86_64                                 2/6 
  Verifying  : libzip-0.10.1-8.el7.x86_64                                   3/6 
  Verifying  : php-process-5.4.16-42.el7.x86_64                             4/6 
  Verifying  : php-common-5.4.16-42.el7.x86_64                              5/6 
  Verifying  : 1:php-pear-1.9.4-21.el7.noarch                               6/6 

Installed:
  php-pear.noarch 1:1.9.4-21.el7                                                

Dependency Installed:
  libzip.x86_64 0:0.10.1-8.el7           php-cli.x86_64 0:5.4.16-42.el7         
  php-common.x86_64 0:5.4.16-42.el7      php-process.x86_64 0:5.4.16-42.el7     
  php-xml.x86_64 0:5.4.16-42.el7        
Complete!


You should also install the php-devel extension, which can be done with the help of the following command.

[root@linuxhelp ~]#  yum install php-devel
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.nhanhoa.com
 * extras: mirrors.nhanhoa.com
 * updates: mirror.vbctv.in
Resolving Dependencies
-->  Running transaction check
--->  Package php-devel.x86_64 0:5.4.16-42.el7 will be installed
-->  Processing Dependency: pcre-devel(x86-64) for package: php-devel-5.4.16-42.el7.x86_64
-->  Running transaction check
--->  Package pcre-devel.x86_64 0:8.32-17.el7 will be installed
-->  Processing Dependency: pcre(x86-64) = 8.32-17.el7 for package: pcre-devel-8.32-17.el7.x86_64
-->  Running transaction check
.
.
.
.
Verifying  : pcre-devel-8.32-17.el7.x86_64                                                                                                                                       3/4 
  Verifying  : pcre-8.32-12.el7.x86_64                                                                                                                                             4/4 

Installed:
  php-devel.x86_64 0:5.4.16-42.el7                                                                                                                                                     

Dependency Installed:
  pcre-devel.x86_64 0:8.32-17.el7                                                                                                                                                      

Dependency Updated:
  pcre.x86_64 0:8.32-17.el7                                                                                                                                                            

Complete!

Now you should install ImageMagick using pecl command.

[root@linuxhelp ~]#  pecl install Imagick
downloading imagick-3.4.3.tgz ...
Starting to download imagick-3.4.3.tgz (245,410 bytes)
...................................................done: 245,410 bytes
19 source files, building
running: phpize
Configuring for:
PHP Api Version:         20100412
Zend Module Api No:      20100525
Zend Extension Api No:   220100525
Please provide the prefix of Imagemagick installation [autodetect] : 
building in /var/tmp/pear-build-rootwYkDqq/imagick-3.4.3
running: /var/tmp/imagick/configure --with-imagick
.
.
.
.
Build process completed successfully
Installing ' /usr/lib64/php/modules/imagick.so' 
Installing ' /usr/include/php/ext/imagick/php_imagick_shared.h' 
install ok: channel://pecl.php.net/imagick-3.4.3
configuration option " php_ini"  is not set to php.ini location
You should add " /"  to php.ini

It doesn' t get over with this, you should also add extension=imagick.so in vim /etc/php.ini, that can be done with the help of the following command.

[root@linuxhelp ~]#  vim /etc/php.ini
extension=imagick.so

[root@linuxhelp ~]#  php -i | grep Imagick
imagick classes =>  Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator
Imagick compiled with ImageMagick version =>  ImageMagick 6.7.8-9 2016-06-16 Q16 http://www.imagemagick.org
Imagick using ImageMagick library version =>  ImageMagick 6.7.8-9 2016-06-16 Q16 http://www.imagemagick.org

ImageMagick has been installed. Now you can check the functioning of the newly installed ImageMagik. Dispay the image you want to convert.

[root@linuxhelp Downloads]#display


The image of ImageMagick gets displayed on your screen.
Image

Now, get into the folder and start the conversion with the help of the commands highlighted below.

[root@linuxhelp ~]# cd /root/Downloads/
[root@linuxhelp Downloads]# ll
total 20
-rw-r--r-- 1 root root 16473 Nov  2 11:26 relax.jpg
[root@linuxhelp Downloads]# display relax.jpg


The image that is to be converted gets displayed on your screen.
jpg

You can now convert the format of the image.

[root@linuxhelp Downloads]# convert relax.jpg relax.png

Once the conversion is done, you can check if the conversion took place.

[root@linuxhelp Downloads]# ll
total 340
-rw-r--r-- 1 root root  16473 Nov  2 11:26 relax.jpg
-rw-r--r-- 1 root root 326026 Nov  2 11:41 relax.png

Also, you can check the image information for further clarification.

[root@linuxhelp Downloads]# display relax.png

3

Thus concludes the installation process of ImageMagik, and the method to covert an image from one format to the other.

Tags:
gabriel
Author: 

Comments ( 3 )

linuxhelp
Thanks for Post
PowsiyaBegum
could not get you.Could you please be clear
spsamy
Not display in phpinfo() file. imagick
Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

How to compile imagemagick from source code?

A

refer the following tutorial https://www.linuxhelp.com/how-to-install-imagemagick-from-source-on-centos-7/

Q

What are all the php version supported for this application?

A

As of now owing to the current update the php version from 5.3/5.4/5.5/5.6/7.0. can be supported

Q

what java version is preferable for php storm?

A

Java 8 is advisable for php storm

Q

Name some alternatives same as PHPlist newsletter?

A

use the following list for alternatives



Sympa

Mailtrain

Maily Herald

OpenEMM

Q

what are other php accelerators available in linux?

A

you can refer the following list



eAccelerator

ionCube PHP Accelerator

Turck MMCache

Xcache

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help David Lopez Guillen ?
Ayuda urgente instale SSL para servidor Opensuse y ahora no funciona tengo servicio web

hola segui este tutorial para tener un certificado ssl y ahora no se ve mi app en la red, espero alguien pueda ayudarme, tengo M9oodle en3.5 en un servidor open suse y ahora no funciona por favor ayuda.

https://www.linuxhelp.com/how-to-create-ssl-certificate-in-opensuse

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.