简体   繁体   中英

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?

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM