How to Install Imagick PHP Extension on Ubuntu 22.04

Websolutionstuff | Mar-06-2024 | Categories : Other

Hey there, fellow developers! Are you looking to enhance your PHP applications with powerful image-processing capabilities? Well, you're in luck because, in this guide, I'll be walking you through the process of installing the Imagick PHP extension on Ubuntu 22.04.

Imagick is a fantastic tool for manipulating images directly within your PHP code, and getting it up and running on your Ubuntu server is easier than you might think. So, let's dive in and get started!

So, let's see how to install the Imagick php extension on Ubuntu 22.04, how to enable the Imagick extension in PHP, and how to enable PHP extensions in Ubuntu 18.04/20.04/22.04.

Step 1: Update Your Package Lists

Before we begin, let's make sure our package lists are up to date. Open up your terminal and run the following command:

sudo apt update

This will ensure that we're working with the latest information about available packages.

 

Step 2: Install Imagick Dependencies

Next, we need to install some dependencies that Imagick relies on. Run the following command to install these packages:

Install Imagick PHP Extension for PHP 8.3

To install Imagick for PHP 8.3, execute the following commands:

sudo apt-get install php8.3-imagick -y

 

Install Imagick PHP Extension for PHP 8.2

To install Imagick for PHP 8.2, execute the following commands:

sudo apt-get install php8.2-imagick -y

 

Install Imagick PHP Extension for PHP 8.1

To install Imagick for PHP 8.1, execute the following commands:

sudo apt-get install php8.1-imagick -y

 

Install Imagick PHP Extension for PHP 8.0

To install Imagick for PHP 8.0, execute the following commands:

sudo apt-get install php8.0-imagick -y

 

Install Imagick PHP Extension for PHP 7.4

To install Imagick for PHP 7.4, execute the following commands:

sudo apt-get install php7.4-imagick -y

 

Install Imagick PHP Extension for PHP 7.3

To install Imagick for PHP 7.3, execute the following commands:

sudo apt-get install php7.3-imagick -y

 

Install Imagick PHP Extension for PHP 7.2

To install Imagick for PHP 7.2, execute the following commands:

sudo apt-get install php7.2-imagick -y
 
Step 3: Restart Apache Server

After installing the Imagick extension, it's crucial to restart the Apache server to apply the changes.

sudo service apache2 restart

 

Step 4: Verify Installation

To verify if the Imagick extension is installed, run the following command:

php -m | grep -i imagick

You can also create a PHP file with the following content:

<?php
phpinfo();
?>

 

Conclusion:

And there you have it! You've successfully installed the Imagick PHP extension on Ubuntu 22.04. With Imagick up and running, you can now take advantage of its powerful image processing capabilities in your PHP applications.

 


You might also like:

Recommended Post
Featured Post
How To Render Charts In React: using react-chartjs-2 and Chart.js
How To Render Charts In React:...

​​React is a really cool tool that helps programmers make awesome user interfaces using JavaScript.  When it com...

Read More

Jul-26-2023

How to install GCC on Ubuntu 22.04
How to install GCC on Ubuntu 2...

Hello there! If you're diving into the world of programming on Ubuntu 22.04 and want to get your hands dirty with so...

Read More

Jan-15-2024

How To Integrate Razorpay Payment Gateway In Laravel 9
How To Integrate Razorpay Paym...

In this article, we see how to integrate razorpay payment gateway in laravel 9. As you all know if you are developi...

Read More

Apr-11-2022

Laravel 9 Two Factor Authentication With SMS
Laravel 9 Two Factor Authentic...

In this article, we will see laravel 9 two-factor authentication with SMS. we will send an OTP SMS to the mobile nu...

Read More

Sep-26-2022