How to install ImageMagick and Imagick on Ubuntu or Debian.

ImageMagick is a popular tool used for creating and modifying images. Check below to know how ImageMagick and Imagick on Ubuntu is installed and configured.

Install ImageMagick

Use a simple apt-get to install this as it is already included in the base repository.

sudo apt-get install imagemagick

Install Imagick

Use apt-get to install imagick -

sudo apt-get install php5-imagick

Enable the module using -

sudo php5enmod imagick

Restart apache or nginx -

//restart nginx server
sudo /etc/init.d/nginx restart

//or restart apache
sudo service apache2 reload

Check phpinfo(); and see if the imagick section appears as below.

imagick config

If you still don't see the above output, try restarting the fpm processes by -

sudo /etc/init.d/php5-fpm restart