【问题标题】:curl and mbstring php 7.1 installation on ubuntu 17.04在 ubuntu 17.04 上安装 curl 和 mbstring php 7.1
【发布时间】:2018-09-18 13:35:38
【问题描述】:

我在 Ubuntu 17.04 上使用 php7.1,我尝试使用以下命令安装 cURL:

sudo apt-get install php-curl

但我明白了:

包'php-curl'没有安装候选

我还尝试使用以下方法指定 cURL 版本:

sudo apt-get install php7.1-curl

但我得到了

E: 用正则表达式 'php7.1-curl 找不到任何包

那么,请问如何为 PHP 7.1 安装 curl?

【问题讨论】:

  • 你安装 curl 了吗?

标签: php ubuntu curl php-7.1


【解决方案1】:

需要先添加PHP ppa,更新,安装

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt install php7.1-curl

【讨论】:

    【解决方案2】:

    虽然您无法找到php-curl 似乎很奇怪,但您应该搜索系统上可用的 php curl 软件包版本:

    sudo apt update
    sudo apt search ^php
    

    在结果之间,它应该显示如下内容(输出取自 Ubuntu 17.10,你的会有所不同):

    php7.1-curl/artful-updates,artful-security 7.1.15-0ubuntu0.17.10.1 amd64
          PHP 的 CURL 模块

    然后,你照常安装它:

    sudo apt install php7.1-curl
    

    编码愉快!

    【讨论】:

    • 这正是我告诉你的!请重新阅读我的答案。
    猜你喜欢
    • 1970-01-01
    • 2021-10-03
    • 2019-01-09
    • 1970-01-01
    • 1970-01-01
    • 2018-01-24
    • 2019-01-06
    • 2018-09-11
    • 2018-09-05
    相关资源
    最近更新 更多