Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install php-curl in Ubuntu 16.04

Upgraded to Ubuntu 16.04 and facing problem after installing PHP5.

Installed PHP-5 with following:

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php5.5   # for PHP 5.5

Trying to install php-curl but its not working.

sudo apt-get install php5-curl

Error: E: Unable to locate package php5-curl

like image 888
Govind Samrow Avatar asked Aug 06 '16 04:08

Govind Samrow


People also ask

How do I download cURL on Ubuntu?

Installing cURL for Ubuntu Linux Update your Ubuntu box, run: sudo apt update && sudo apt upgrade. Next, install cURL, execute: sudo apt install curl. Verify install of curl on Ubuntu by running: curl --version. Search for libcurl bindings for your programming needs: apt-cache search libcurl | grep python.

How check cURL is installed or not in PHP?

To check whether PHP's cURL support is installed on your server, complete the following steps: Log in to your administration panel. Click on the bug icon, that will appear in the upper right corner of the page. The debugger panel will open.


3 Answers

In Ubuntu 16.04 default PHP version is 7.0, if you want to use different version then you need to install PHP package according to PHP version:

  • PHP 7.4: sudo apt-get install php7.4-curl
  • PHP 7.3: sudo apt-get install php7.3-curl
  • PHP 7.2: sudo apt-get install php7.2-curl
  • PHP 7.1: sudo apt-get install php7.1-curl
  • PHP 7.0: sudo apt-get install php7.0-curl
  • PHP 5.6: sudo apt-get install php5.6-curl
  • PHP 5.5: sudo apt-get install php5.5-curl
like image 162
Govind Samrow Avatar answered Oct 14 '22 07:10

Govind Samrow


This worked for me.

sudo apt-get install php-curl
like image 22
Aaganja Avatar answered Oct 14 '22 07:10

Aaganja


This works for me:

sudo apt-get install php5.6-curl
like image 21
Nehal J Wani Avatar answered Oct 14 '22 06:10

Nehal J Wani