Composer 安装错误 - 实际启用时需要 ext_curl [英] Composer install error - requires ext_curl when it's actually enabled
问题描述
我正在尝试使用 Composer 安装 Facebook PHP SDK.这是我得到的
I'm trying to install Facebook PHP SDK with Composer. This is what I get
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for facebook/php-sdk dev-master -> satisfiable by facebook/php-sdk[dev-master].
- facebook/php-sdk dev-master requires ext-curl * -> the requested PHP extension curl is missing from your system.
问题是,我启用了 curl 扩展(在 php.ini 中未注释).当我运行 phpinfo()
时,它说它已启用.我唯一的线索是,当我运行 $ php -m
时,'curl' 行丢失了,但我不知道该怎么办.
Problem is, I have curl extension enabled (uncommented in php.ini). When I run phpinfo()
, it says it's enabled.
Only clue I have is that when I run $ php -m
, 'curl' line is missing but I don't know what to do about it.
我在 Win8 上有 wamp 2.4,我在 cmd.exe 中运行 composer.
I have wamp 2.4 on Win8 and I'm running composer in cmd.exe.
推荐答案
这是因为你的系统中没有安装php5-curl库,
This is caused because you don't have a library php5-curl installed in your system,
在 Ubuntu 上,它只是简单地运行下面的行代码,在 Xamp 的情况下,请查看 Xamp 文档
On Ubuntu its just simple run the line code below, in your case on Xamp take a look in Xamp documentation
sudo apt-get install php5-curl
对于任何使用 php7.0 的人
For anyone who uses php7.0
sudo apt-get install php7.0-curl
对于使用php7.1的人
For those who uses php7.1
sudo apt-get install php7.1-curl
对于使用php7.2的人
For those who use php7.2
sudo apt-get install php7.2-curl
对于使用php7.3的人
For those who use php7.3
sudo apt-get install php7.3-curl
对于使用php7.4的人
For those who use php7.4
sudo apt-get install php7.4-curl
对于使用php8.0的人
For those who use php8.0
sudo apt-get install php8.0-curl
或者简单地运行以下命令以根据您的版本进行安装:
Or simply run below command to install by your version:
sudo apt-get install php-curl
这篇关于Composer 安装错误 - 实际启用时需要 ext_curl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!