I'm using php7.1 on Ubuntu 17.04, I have tried to install cURL using this command:
sudo apt-get install php-curl
but I get this:
Package 'php-curl' has no installation candidate
I tried also to specify the cURL version using:
sudo apt-get install php7.1-curl
but i got
E: Couldn't find any package by regex 'php7.1-curl
So, please, how do I install curl for PHP 7.1?
You need to add PHP ppa first, update, and install
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt install php7.1-curl
While it seems strange that you are not able to find php-curl
, you should search for php curl package version available on your system:
sudo apt update
sudo apt search ^php
Between the results, it should display something like this (the output was taken from Ubuntu 17.10, yours will be different):
php7.1-curl/artful-updates,artful-security 7.1.15-0ubuntu0.17.10.1 amd64 CURL module for PHP
then, you just install it as usual:
sudo apt install php7.1-curl
happy coding!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With