How to install php-curl in Ubuntu 16.04
242,870
Solution 1
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
Solution 2
This worked for me.
sudo apt-get install php-curl
Solution 3
This works for me:
sudo apt-get install php5.6-curl
Solution 4
Do:
apt-get update
And then:
apt-get install php5-curl
Solution 5
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt install php8.0-curl
Related videos on Youtube
Author by
Govind Samrow
I’m software engineer. I've complete my post graduation from Punjabi university, Patiala. I love my family, my state (Punjab) and my country. I'm son of Farmer ,I'm from village Arakwas, dist. sangrur and now in Chandighar.
Updated on March 13, 2021Comments
-
Govind Samrow about 3 years
Upgraded to
Ubuntu 16.04
and facing problem after installingPHP5
.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
-
I wrestled a bear once. over 7 yearsare you sure it's not installedand not just disabled? use
php5enmod
command to enable it. -
Blue over 7 yearsIs there a reason why you need to use php 5.5? It's reached it's end of life, and is no longer supported (There are many security issues)
-
Govind Samrow over 7 years@frankerZ My projects not working under PHP7
-
Blue over 7 yearsAre these huge projects? I think you should lean toward making your projects work in the latest version, then installing an old php to support this project.
-
Govind Samrow over 7 yearsI've 15-20 projects on local and live servers not in my hand
-
-
Yankee over 7 yearsYes, this works without having to specify a PHP version if the user doesn't know it.
-
Riz about 7 yearsWorked for me too on Amazon EC2 Ubuntu 16
-
ShadowZzz over 6 yearsFor me, this was exactly the case. Had PHP 7 installed and kept getting
Package 'php5-curl' has no installation candidate
. Runningsudo apt-get install php-curl
fixed the problem -
Davinder Kumar over 6 yearsyeah, it Works.
-
little tiny man over 6 yearsuse
php -version
to find out what version of PHP you're on -
GTodorov over 5 yearsPerfect, but how do you fix libcurl issues with PHP 7.2 (needs libcurl4) and Percona MySQL 5.7 (needs libcurl3)?
-
Juyal Jee over 5 years@ShadowZzz yes, your suggestion worked for me as well.
-
Jakob Alexander Eichler over 5 yearsIt seems, that these versions are no longer part of ubuntu 18.10
-
elfTine over 5 yearsHey, Thanks a lot!! You save me :)