How to Install ImageMagick 7 on Ubuntu LEMP/LAMP stacks
Last updated: November 1st 2023
Introduction
This article provides instructions on how to install ImageMagick version 7, along with the PHP extension.
We'll use a script to install the ImageMagick, and then compile the PHP extension.
Let's get started.
Prerequisites
- A server using Ubuntu LEMP/LAMP image
- SSH access to your server.
Note: The below steps have to be rerun if you change the PHP version on your Ubuntu LEMP/LAMP stack from the "Manage PHP" screen.
Installing ImageMagick v7
We'll use the ImageMagick Easy Install script to install it.
First, remove the existing imagemagick package if it is already installed using:
$ sudo apt remove imagemagick
Switch to root user using:
$ sudo su
Now run the IM7 script. Copy/paste the below command to the command line and run it. For changing the build options, please check the easy install script documentation.
t=$(mktemp) && \ wget 'https://dist.1-2.dev/imei.sh' -qO "$t" && \ bash "$t" && \ rm "$t"
The script will take a while to finish the compilation and will install the latest version of ImageMagick.
To verify the installed version, you can check by running the below command.
$ convert --version
Sample output:
Version: ImageMagick 7.1.1-21 Q16-HDRI x86_64 dcffc2de3:20231021 https://imagemagick.org Copyright: (C) 1999 ImageMagick Studio LLC License: https://imagemagick.org/script/license.php Features: Cipher DPC HDRI Modules OpenMP(4.5) Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype gslib gvc heic jbig jng jp2 jpeg jxl lcms lqr ltdl lzma openexr pangocairo png ps raqm raw rsvg tiff webp wmf x xml zip zlib Compiler: gcc (11.4)
Installing the Imagick PHP Extension
Make sure you have git installed. If it's not installed you can install it using apt.
$ sudo apt install git
Now, to install the imagick PHP extension run the below commands as the root user.
$ git clone https://github.com/Imagick/imagick
$ cd imagick
$ phpize && ./configure
$ make
$ make install
After the imagick extension is installed you can verify it on the phpinfo page.
That's it :)
Conclusion
This article provided instructions on how you can install the latest version of ImageMagick along with the PHP extension.
Related articles
-
How to install OpenLiteSpeed on Webdock
In this article we show you how you can install the OpenLiteSpeed web server on Ubuntu Jammy.
-
How to Deploy your First Node.js Application on your Ubuntu Web Server
-
How to set up WireGuard on your Webdock Server
This article details how you can quickly and easily install WireGuard on your Webdock Server.
-
How to set up OpenVPN on your Webdock Server
This article details how you can quickly and easily set up a VPN on your Webdock server.
-
How to Install and configure aaPanel on Ubuntu
-
How to install azuracast on Webdock
This guide shows you how to work around certain issues when installing azuracast on Webdock.
-
How to set up Runcloud on Webdock
-
How to set up cPanel on Webdock
-
How to set up Gridpane on Webdock
-
How to set up Ploi on Webdock
This article details the steps you need to go through in order to install Ploi on a Webdock server.
-
How to set up Laravel Forge on Webdock
-
How to set up Plesk on Webdock
This article details the steps you need to go through in order to install Plesk on a Webdock server.
-
How to set up Cyberpanel on Webdock
-
How to set up SpinupWP on Webdock
-
How to set up DirectAdmin on Webdock
-
How to set up Hestia on Webdock
-
How to set up Virtualmin on Webdock
-
How to install and create pipelines in Jenkins
-
Basic WordPress site setup with aaPanel
In this guide, we will install and setup a basic WordPress site with aaPanel.
-
How to use Nginx as reverse proxy and secure connections with SSL certificates
Using Nginx to proxy pass your site with SSL security.
-
Setting up monitoring with Netdata on your Webdock server
-
How to Setup Python Web Application With Flask Gunicorn and Nginx
A simple Python Flask web app hosting with Gunicorn and Nginx
-
How to Daemonize an Application with Systemd
Using systemd to autostart your application on system startup.
-
Set-up New Relic Monitoring on Your Webdock Server
This guide provides step-by-step instructions to install New Relic to monitor your VPS.
-
Getting Started with Ruby on Rails on Webdock
In this guide, we will show you how to get started with Ruby on Rails on your Webdock server
-
How to Install VaultWarden on Your Webdock Server
-
How to Install the Latest Version of HTOP on Ubuntu Server
Instructions to install latest htop package on your Ubuntu server