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

新手上路,请多包涵

我正在尝试使用 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。

原文由 Michal Artazov 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 700
2 个回答

这是因为您的系统中没有安装库 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

原文由 Adriano Rosa 发布,翻译遵循 CC BY-SA 4.0 许可协议

如果你是 ubuntu,这对你有用。

作曲家更新--ignore-platform-reqs

原文由 ojames314 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题