Open In App

How to Install Imagick for PHP on AWS EC2?

Improve
Improve
Like Article
Like
Save
Share
Report

AWS or Amazon web services is a cloud service platform. It provides on-demand computational services, databases, storage space, and many more services. EC2 or Elastic Compute Cloud is a scalable computing service launched on the AWS cloud platform. Or in other words, EC2 is a virtual computer on which we can perform all our tasks and we have the authority to configure, launch or even dissipate this virtual computer. 

Imagick is a PHP ImageMagick extension. It is used 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. In this article, we will learn how to install Imagick for PHP on AWS EC2.

Prerequisite:

  1. AWS account.
  2. EC2 Instance.
  3. User with privileges to create an instance. 
  4. PHP should already be installed.

Installing Imagick for PHP on AWS EC2 

Follow the steps below to install Imagick for PHP on AWS EC2:

Step 1: Create an AWS Elastic Cloud Compute instance. 

Step 2: Start the EC2 instance that you have already created above step.

Start-the-EC2-instance

Step 3: Click on Connect button to connect the EC2 instance. 

Connect-to-EC2-instance

Step 4: A prompt window will pop up after connecting.

Prompt-will-open

Step 5: Check if PHP is already installed or not on our AWS EC2.

php –version

Checking-PHP-version

Step 6: If PHP is not installed on your AWS EC2, then install PHP, to do so visit How-To-Install-PHP-On-AWS.

Step 7: At first update, Ubuntu packages by using the following command.

sudo apt update

Update-package

Step 8: Install Imagick for PHP on AWS EC2 using the following command.

sudo apt install php-imagick

Install-Imagick

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

Step 10: Wait for the installation process to end.

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

Step 11: We have successfully installed Imagick for PHP on AWS EC2, to check if Imagick is successfully installed or not, verify using the following command.

php -m | grep imagick

Verify-Imagick

This is how we install Imagick for PHP on our EC2 instance using EC2 Instance Connect and if you also use a free tier account, make sure you delete all the resources you have used before logging out. 


Last Updated : 28 Mar, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads