由于多个PHP版本,Composer没有安装最新的facebook PHP SDK


composer not installing latest facebook php sdk due to multiple php versions

我试图加载最新的php sdk的facebook,但我得到错误的作曲家。你知道我做错了什么吗?

{
  "minimum-stability": "dev",
  "require" : {
    "facebook/php-sdk-v4" : "4.0.*"
  }
}
[root@gridjungle gridjungle]# composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - facebook/php-sdk-v4 4.0.8 requires php >=5.4.0 -> no matching package found.
    - facebook/php-sdk-v4 4.0.7 requires php >=5.4.0 -> no matching package found.
    - facebook/php-sdk-v4 4.0.6 requires php >=5.4.0 -> no matching package found.
    - facebook/php-sdk-v4 4.0.5 requires php >=5.4.0 -> no matching package found.
    - facebook/php-sdk-v4 4.0.4 requires php >=5.4.0 -> no matching package found.
    - facebook/php-sdk-v4 4.0.3 requires php >=5.4.0 -> no matching package found.
    - facebook/php-sdk-v4 4.0.2 requires php >=5.4.0 -> no matching package found.
    - facebook/php-sdk-v4 4.0.1 requires php >=5.4.0 -> no matching package found.
    - facebook/php-sdk-v4 4.0.0 requires php >=5.4.0 -> no matching package found.
    - Installation request for facebook/php-sdk-v4 4.0.* -> satisfiable by facebook/php-sdk-v4[4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4,

4.0.5, 4.0.6, 4.0.7, 4.0.8].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion>

查看详细信息。

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
[root@gridjungle gridjungle]# composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update

来更新它们。无需安装或更新生成自动加载文件

版本4+的PHP SDK需要PHP 5.4+。

如果你不能升级你的PHP版本,你将不得不使用旧的SDK, "facebook/PHP - SDK "

Fosco是对的。由于安装了多个版本的PHP,我必须指定编写器使用哪个版本。为了做到这一点,我必须在我的项目位置本地安装composer,而不是使用全局安装的版本。
/usr/local/php-5.5.13-cgi/bin/php composer.phar update