php7.2.7curl扩展,如何使用PHP 7安装ext-curl扩展?

如何使用PHP 7安装ext-curl扩展?

我使用这个repo安装了PHP 7,但是当我尝试运行composer install时,它给出了这个错误:

[包]需要ext-curl * - > 系统中缺少所请求的PHP扩展curl。

使用PHP 5,您可以通过运行yum或apt-get install php5-curl命令轻松安装它,但我找不到如何安装PHP 7等效项。

如何为PHP 7安装ext-curl?

7个解决方案

330 votes

好吧,我能够通过以下方式安装它:

sudo apt-get install php-curl

在我的系统上。 这将安装依赖包,这取决于默认的PHP版本。

之后重启apache

sudo service apache2 restart

Sabeeh Chaudhry answered 2019-05-25T17:47:59Z

83 votes

请试试

sudo apt-get install php7.0-curl

jk2K answered 2019-05-25T17:48:25Z

18 votes

如果“sudo apt-get install php-curl”命令不起作用并显示错误我们应该在安装curl之前运行这段代码。

step1 - sudo add-apt-repository ppa:ondrej / php

step2 - sudo apt-get update

step3 - sudo apt-get install php-curl

step4 - sudo service apache2 restart

Bijaya Kumar Oli answered 2019-05-25T17:49:17Z

9 votes

我们可以在安装时安装我们需要的任何PHP7扩展Magento只使用相关命令,你在安装时遇到错误Magento

sudo apt-get install php7.0-curl

sudo apt-get install php7.0-dom

sudo apt-get install php7.0-mcrypt

sudo apt-get install php7.0-simplexml

sudo apt-get install php7.0-spl

sudo apt-get install php7.0-xsl

sudo apt-get install php7.0-intl

sudo apt-get install php7.0-mbstring

sudo apt-get install php7.0-ctype

sudo apt-get install php7.0-hash

sudo apt-get install php7.0-openssl

sudo apt-get install php7.0-zip

sudo apt-get install php7.0-xmlwriter

sudo apt-get install php7.0-gd

sudo apt-get install php7.0-iconv

谢谢! 希望对你有帮助

Narendra Solanki answered 2019-05-25T17:49:50Z

7 votes

我尝试了上面的解决方案,但它对我不起作用,只是让任何其他人穿着同样的鞋子,这就是我所做的。我使用以下命令更新了apt-get

sudo add-apt-repository ppa:ondrej/php

这个我用php curl安装我正在使用的php版本,我的

sudo apt-get install php7.1-curl

Excellent Lawrence answered 2019-05-25T17:50:26Z

1 votes

安装php70w-common。

它提供php-api,php-bz2,php-calendar,php-ctype,php-curl,php-date,php-exif,php-fileinfo,php-filter,php-ftp,php-gettext,php-gmp, php-hash,php-iconv,php-json,php-libxml,php-openssl,php-pcre,php-pecl-Fileinfo,php-pecl-phar,php-pecl-zip,php-reflection,php-session, php-shmop,php-simplexml,php-sockets,php-spl,php-tokenizer,php-zend-abi,php-zip,php-zlib。

[https://webtatic.com/packages/php70/]

CiaranSynnott answered 2019-05-25T17:51:06Z

-2 votes

如果你得到E: Unable to locate package {packageName},试试吧

sudo add-apt-repository main

sudo add-apt-repository universe

sudo add-apt-repository restricted

sudo add-apt-repository multiverse

sudo add-apt-repository ppa:ondrej/php

sudo apt-get update

sudo apt-get install php-curl

Liao San Kai answered 2019-05-25T17:51:31Z

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值