php - Composer 安装错误 - 实际启用时需要 ext_curl

标签 php windows curl facebook-php-sdk composer-php

我正在尝试使用 Composer 安装 Facebook PHP SDK。这就是我得到的

$ 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' 行不见了,但我不知道该怎么办。

我在 Win8 上安装了 wamp 2.4,并且正在 cmd.exe 中运行 composer。

最佳答案

这是因为您的系统中没有安装库 php5-curl,

在 Ubuntu 上,只需简单地运行下面的行代码,在 Xamp 上,请查看 Xamp 文档

sudo apt-get install php5-curl

对于任何使用 php7.0 的人

sudo apt-get install php7.0-curl

对于使用php7.1的人

sudo apt-get install php7.1-curl

对于使用php7.2的人

sudo apt-get install php7.2-curl

对于使用php7.3的人

sudo apt-get install php7.3-curl

对于使用php7.4的人

sudo apt-get install php7.4-curl

对于使用php8.0的人

sudo apt-get install php8.0-curl

或者简单地运行下面的命令来安装你的版本:

sudo apt-get install php-curl

关于php - Composer 安装错误 - 实际启用时需要 ext_curl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19335305/

相关文章:

php - jQuery Ajax Json 响应 - 检查是否为 null

Controller 数组中的 Javascript 不起作用

bash - 通过 bash 脚本执行 curl 请求

c - 如何在c中的curl post请求中设置cookie

php - 访问数组中的显式对象

php - 用 PHP 编写的流行的商业应用程序示例?

c++ - 如何在后台启动 GUI 应用程序?

windows - 在 Windows 命令提示符中查找已安装应用程序的日期和时间

c - 如何模拟按键

c++ - cURL - 多 - 打开的套接字太多