无法更新composer.phar - Symfony

时间:2015-07-06 12:35:30

标签: php symfony

当我尝试使用terminal命令更新软件包时:php composer.phar update我有此错误消息

  

您的要求无法解析为可安装的软件包。

问题1

- sensio/distribution-bundle v4.0.0 requires sensiolabs/security-checker ~2.0 -> satisfiable by sensiolabs/security-checker[v2.0.5, v2.0.0, v2.0.1, v2.0.2, v2.0.3, v2.0.4].
- sensio/distribution-bundle v4.0.0 requires sensiolabs/security-checker ~2.0 -> satisfiable by sensiolabs/security-checker[v2.0.5, v2.0.0, v2.0.1, v2.0.2, v2.0.3, v2.0.4].
- sensiolabs/security-checker v2.0.5 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- sensiolabs/security-checker v2.0.4 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- sensiolabs/security-checker v2.0.3 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- sensiolabs/security-checker v2.0.2 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- sensiolabs/security-checker v2.0.1 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- sensiolabs/security-checker v2.0.0 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- sensiolabs/security-checker v2.0.5 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- Installation request for sensio/distribution-bundle ~4.0 -> satisfiable by sensio/distribution-bundle[v4.0.0]."

2 个答案:

答案 0 :(得分:2)

从消息中可以看出:您需要为PHP安装ext-curl扩展名。

要在Ubuntu中安装它,您需要运行下一个命令:

sudo apt-get install php5-curl

不要忘记在它之后重启apache(或fpm):

sudo service apache2 restart

或fpm:

sudo service php5-fpm restart

答案 1 :(得分:1)

错误消息告诉您sensio / distribution-bundle v4需要sensiolabs / security-checker v2.0.x,而后者又需要PHP curl扩展,但未安装。因此,作曲家不能(目前)满足你的composer.json中指定的要求。在基本级别,您需要安装curl扩展名。

为什么在你的情况下发生这种情况很难确定而没有更多细节:

  • 您最近是否已从分发包v3升级到v4?看起来在这些之间引入了对安全检查程序的依赖性。您可以恢复到v3以避免此问题。
  • PHP环境是否已更改,以删除curl扩展名?