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

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

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

如何为PHP 7安装ext-curl ?


当前回答

sudo apt-get install php7.0-curl

其他回答

sudo apt-get install php7.0-curl

好吧,我可以安装它:

sudo apt-get install php-curl

在我的系统上。这将安装一个依赖包,依赖于默认的php版本。

然后重启apache

sudo service apache2 restart

我们可以安装任何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

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

步骤1 - sudo添加-apt-repository ppa:ondrej/php 步骤2 - sudo apt-get更新 步骤3 - sudo apt-get安装php-curl 步骤4 - sudo服务apache2重启

安装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/