How To Install PHP CURL Extension In Ubuntu

Websolutionstuff | Jul-21-2023 | Categories : PHP

In this article, we will focus on the installation process of the PHP cURL extension in Ubuntu 22.04. The PHP cURL extension offers a user-friendly interface for handling HTTP requests, exchanging data with remote servers, and working with various protocols like HTTP, HTTPS, FTP, and more.

By adding this extension to your PHP environment, you equip your applications with robust networking capabilities.

In the upcoming sections, we will present you with a step-by-step guide on how to install the PHP cURL extension on your Ubuntu 18.04, Ubuntu 20.04, and Ubuntu 22.04 system. We will detail the required commands and configurations to ensure a successful installation.

Let's begin and explore the installation of the PHP cURL extension on your Ubuntu environment.

Step 1: Update Package Lists

Open a terminal window and run the following command to update the package lists.

sudo apt update

 

Step 2: Install the PHP cURL Extension

Once the package lists are updated, you can proceed to install the PHP cURL extension by running the following command.

sudo apt-get install php-curl

 

PHP 8.2

Run the following command to install php-curl for PHP 8.2.

sudo apt-get install php8.2-curl

 

PHP 8.1

Run the following command to install php-curl for PHP 8.1.

sudo apt-get install php8.1-curl

 

 PHP 8.0

Run the following command to install php-curl for PHP 8.0.

sudo apt-get install php8.0-curl

 

 PHP 7.4

Run the following command to install php-curl for PHP 7.4.

sudo apt-get install php7.4-curl

 

 PHP 7.3

Run the following command to install php-curl for PHP 7.3.

sudo apt-get install php7.3-curl

 

Step 3: Restart Apache Server

After the installation is complete, you need to restart the PHP service for the changes to take effect. Run the following command to restart PHP.

sudo service apache2 restart

 

Step 4: Check php-curl Extension Installed

To ensure that php-curl is successfully installed. Run the following command to check.

php -m | grep -i curl

 


You might also like:

Recommended Post
Featured Post
Laravel 9 CRUD With Image Upload Example
Laravel 9 CRUD With Image Uplo...

In this article, we will see the laravel 9 crud with an image upload example. Here, we will learn how to image upload wi...

Read More

Dec-09-2022

Carbon diffForHumans Laravel Example
Carbon diffForHumans Laravel E...

In this article, we will see carbon diffForHumans in laravel. Carbon diffForHumans function in carbon provides the...

Read More

Dec-14-2020

jQuery Show and Hide Effects Example
jQuery Show and Hide Effects E...

Hello friends, in this tutorial, we will see jQuery show and hide effects example. jQuery show method and jQuery...

Read More

Jan-21-2022

Laravel 9 Livewire Datatable Example
Laravel 9 Livewire Datatable E...

In this article, we will see the laravel 9 livewire datatable example. Here, we will learn how to use livewire data...

Read More

Nov-30-2022