Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Linux Tutorials»How to Install ImageMagick on Ubuntu 18.04 & 16.04 LTS

    How to Install ImageMagick on Ubuntu 18.04 & 16.04 LTS

    By RahulMarch 27, 20192 Mins Read

    ImageMagick is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats like GIF, JPEG, PNG, Postscript, and TIFF. We can also use 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ézier curves.

    Advertisement

    This article will help you to install ImageMagick on 19.04, 18.04 & 16.04 LTS operating systems.

    Step 1 – Prerequsities

    First of all, You need to install the required packages in order to install ImageMagick and Imagick PHP extension. You can also visit our tutorial to install different versions of PHP on Ubuntu.

    sudo apt install php php-common gcc
    

    Step 2 – Install ImageMagick

    After installing required packages, let’s install ImageMagick using the following command. ImageMagick package is available under default apt repositories.

    sudo apt install imagemagick
    

    Step 3 – Install imagick PHP Extension

    At this point, you have successfully installed ImageMagick package on your system. Now, you need to install Imagick PHP extension, So that we can use it through PHP code.

    sudo apt install php-imagick
    

    For different PHP version’s you need to install the specific version of imagick like php7.1-imagick or php7.3-imagick etc.

    Step 4 – Restart Apache and Verify

    After completing above steps you need to reload apache service to enable php exension using following command

    sudo systemctl restart apache2
    

    Now verify that module is enabled properly.

    php -m | grep imagick
    
    imagick
    

    You can also create phpinfo() file to view ImageMagick on the web browser.

    imagematick-on-ubuntu

    Click here to read more details about ImageMagick setup and there uses.

    imagemagick imagick PHP
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Understanding 2>&1 in Bash: A Beginner’s Guide

    How to Choose the Best Shebang (#!) for Your Shell Scripts

    PHP Arrays: A Beginner’s Guide

    View 20 Comments

    20 Comments

    1. eplt on June 24, 2019 3:54 am

      Useful info. I did mine with HEIC support.

      https://medium.com/@eplt/5-minutes-to-install-imagemagick-with-heic-support-on-ubuntu-18-04-digitalocean-fe2d09dcef1

      Reply
    2. roziq on June 18, 2019 2:55 pm

      how to use it on xampp?
      i’ve try all the steps but imagick still not show in phpinfo

      Reply
    3. Joy on March 6, 2018 7:47 am

      Thanks a lot for your post, and it helped me to install imagick on my unbutu.

      While I confused a little bit in step 3. It should be imagick PHP Extension but not ImageMagick PHP Extension.

      Reply
    4. Gustav Sommer on December 10, 2016 10:42 am

      short and very good, thank you

      Reply
    5. Timo on May 13, 2016 10:21 am

      Thank you!

      Reply
    6. Ruriko on January 13, 2016 9:04 am

      What if I don’t use apache but nginx instead? how would I install ImageMagick on a nginx webserver?

      Reply
    7. Sino on December 6, 2015 1:22 am

      THANKS!

      I was trying to get jpeg / jpg file uploads working with mediawiki 1.23.6 on CentOS 7 with Apache/2.4.6 and php 5.4.16. I ran the command:

      yum install php-pear ImageMagick ImageMagick-devel ImageMagick-perl

      restarted httpd, and now everything works. Thanks!

      Sino

      Reply
    8. Gnoll110 on December 3, 2015 8:06 pm

      sudo apt-get install libmagickwand-dev

      I found I had to install the above package to get the rmagick gem to install.

      Reply
    9. Shirley on November 17, 2015 11:26 am

      So great !

      Reply
    10. Rene on September 13, 2015 4:47 pm

      Reloading apache isn’t enough. Restarting should do the trick

      Reply
    11. Hiren on May 30, 2015 3:58 pm

      Thank you…………..

      Reply
    12. Leandro dos Santos on April 24, 2015 9:28 pm

      # echo “extension=imagick.so” > /etc/php.d/imagick.ini
      -bash: /etc/php.d/imagick.ini: No such file or directory

      How to solve this?

      Reply
      • Rahul on April 25, 2015 3:07 am

        It looks /etc/php.d directory doesn’t exists on your system. Add “extension=imagick.so” in your php.ini file.

        Reply
    13. James on December 5, 2014 12:13 am

      Thanks, very useful quick reference! Cheers 🙂

      Reply
    14. Tim on November 14, 2014 10:11 am

      php-pecl-imagick will install the php extension for you on CentOS / RHEL

      Reply
    15. Alexandr on November 7, 2014 8:45 am

      Спасибо (thank you)!

      Reply
    16. Jo on November 5, 2014 10:38 pm

      This was just what I was looking for, Thank you for helping me install ImageMagick on my CentOS 7.0 VM!

      Reply
    17. John on October 15, 2014 8:35 am

      Thanks for the instructions.

      If you run into problems you may be that the /var/tmp directory is on a different drive to / and that you can’t build the files (our Rackspace servers running RHEL / CentOS are setup like this) – to get around this you can temporarily give /var/tmp executable permission e.g.

      mount -o remount,exec /var/tmp/
      (do stuff)
      then change the permissions back…
      mount -o remount,noexec /var/tmp/

      Reply
    18. Akshay on August 22, 2014 4:35 am

      Thanks

      Reply
    19. Usama on March 16, 2014 6:03 pm

      Thanks….

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • How to List Manually Installed Packages in Ubuntu & Debian
    • 10 Bash Tricks Every Developer Should Know
    • How to Validate Email Address in JavaScript
    • Firewalld: Common Firewall Rules and Commands
    • 12 Apk Commands in Alpine Linux Package Management
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.