Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

curl and mbstring php 7.1 installation on ubuntu 17.04

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?

like image 944
Ahmad Avatar asked Apr 09 '18 08:04

Ahmad


Video Answer


2 Answers

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
like image 192
Glend Maatita Avatar answered Sep 30 '22 14:09

Glend Maatita


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!

like image 39
Binar Web Avatar answered Sep 30 '22 14:09

Binar Web