87

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

Govind Samrow
  • 9,981
  • 13
  • 53
  • 90

8 Answers8

267

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
AndrewRMillar
  • 608
  • 1
  • 7
  • 17
Govind Samrow
  • 9,981
  • 13
  • 53
  • 90
35

This worked for me.

sudo apt-get install php-curl
Aaganja
  • 524
  • 3
  • 12
21

This works for me:

sudo apt-get install php5.6-curl
Nehal J Wani
  • 16,071
  • 3
  • 64
  • 89
7

Do:

apt-get update

And then:

apt-get install php5-curl
k0pernikus
  • 60,309
  • 67
  • 216
  • 347
4
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt install php8.0-curl
Vitalicus
  • 1,188
  • 13
  • 15
3

To Install cURL 7.49.0 on Ubuntu 16.04 and Derivatives

wget http://curl.haxx.se/download/curl-7.49.0.tar.gz
tar -xvf curl-7.49.0.tar.gz
cd curl-7.49.0/
./configure
make
sudo make install
George
  • 330
  • 1
  • 8
  • 19
Khalid Bin Huda
  • 1,583
  • 17
  • 16
3

For Ubuntu 18.04 or PHP 7.2 users you can do:

apt-get install php7.2-curl

You can check your PHP version by running php -v to verify your PHP version and get the right curl version.

Yaser AlAzem
  • 97
  • 1
  • 10
2
sudo apt-get install php5.6-curl

and restart the web browser.

You can check the modules by running php -m | grep curl

Robert
  • 5,278
  • 43
  • 65
  • 115
Linuxian
  • 106
  • 9