Install ImageMagick module for PHP on Ubuntu

ImageMagick is a very popular image editing suite, and for good reasons. It's command-based and is very capable: making it perfect as a backend to many other image manipulation tools.

The default image library for PHP is GD. You can use ImageMagick to replace GD in PHP by installing php-imagick on Ubuntu following these steps;

  1. Update apt's package list.
    $ sudo apt update
  2. Install php-imagick package.
    $ sudo apt install -y php-imagick
  3. Check if imagick module is loaded by PHP.
    $ php -m | grep imagick
  4. Restart Apache or any other services dependent on PHP.
    $ sudo systemctl restart apache2

Sign up for Learn Linux in 5 Days and Level Up Your Career and many other great courses on Udemy to learn more.

Written by Mohd Shakir Zakaria. Last updated on 2019-02-12