我试图安装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.

问题是,我有卷曲扩展启用(未注释在php.ini)。当我运行phpinfo()时,它说它已启用。 我唯一的线索是,当我运行$ php -m, '卷曲'行是缺失的,但我不知道该怎么做。

我在Win8上有wamp 2.4,我在cmd.exe中运行作曲家。


当前回答

例如在php7上运行:

> sudo apt-get install php-curl
> sudo apt-get install php-mbstring

对于每一个缺失的扩展。然后:

> sudo apt-get update

最后(在项目的根文件夹中):

> composer install

其他回答

例如在php7上运行:

> sudo apt-get install php-curl
> sudo apt-get install php-mbstring

对于每一个缺失的扩展。然后:

> sudo apt-get update

最后(在项目的根文件夹中):

> composer install

根据https://github.com/composer/composer/issues/2119,你可以扩展你的本地作曲家。Json声明它提供了扩展(实际上它并没有这样做——这就是为什么你不应该公开发布你的包,只在内部使用它)。

在我的例子中,我从PHP5移动到PHP7,我得到了这个错误, 只需转到/bin/php/php7/php.ini,然后取消注释extension=php_curl.dll,重新启动服务器,重新运行composer安装。

如果你是ubuntu,这将为你工作。

composer update --ignore-platform-reqs

对于任何在Windows上遇到这个问题的人,我在谷歌上根本找不到我的答案。 我刚刚试着运行作曲家要求ext-curl,这是有效的。 或者在编写器中添加以下内容。json文件:

"require": {
"ext-curl": "^7.3"
}