Let’s start off with a freshly installed server running Ubuntu 16.04 (server).

This article assumes that you have Apache and PHP installed already.

Issue the following command at shell to install the base ImageMagick library:

The next step is to install the PHP library for ImageMagick, but you need to install a couple of pre-requisites for it:

Now to install the imagick library:

Restart or reload apache:

To verify that the imagick library has been added to php you have two options:

1) Issue the following command at shell to verify successful installation:

2) Drop a test.php file with the following content in the html directory (default: /var/www/html)

That’s it, you should be good.