Open In App

How to Install Imagick for PHP in Linux?

Improve
Improve
Like Article
Like
Save
Share
Report

Imagick is a PHP ImageMagick extension. It is a native PHP extension to create and modify images using the ImageMagick API. It is used to read, write, and convert the images in any formats including, EXR, GIF, JPEG, PDF, PNG, PhotoCD, TIFF, etc. In this article, we will learn how to install Imagick for PHP in Linux.

Prerequisite:

  1. PHP should already be installed.
  2. User with root privileges.

Installing Imagick in Linux

Follow the steps below to install Imagick for PHP in Linux:

Step 1: Check if PHP is already installed or not.

php –version

Checking-PHP-version

Step 2: If PHP is not installed on your Linux device, then install PHP, to do so visit Install-PHP-On-Linux.

Step 3: Update packages by using the following command:

sudo apt update

Update-ubuntu-package

Step 4: Install Imagick for PHP on Linux using the following command:

sudo apt install php-imagick

Install-Imagick

Step 5:  A prompt will appear asking you for confirmation, press ‘y’ to confirm.

Step 6: Wait for the installation process to end.

Wait-for-the-installation-process-to-end

Step 7: We have successfully installed Imagick for PHP on Linux, to check if Imagick is successfully installed or not, verify using the following command:

php -m | grep imagick

Verify-Imagick

In this way, we can install Imagick for PHP on our Linux devices.


Last Updated : 31 Jan, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads