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