在composer.json中包含PHP和AWS时出错

时间:2014-06-05 12:18:07

标签: php amazon-web-services amazon-s3 composer-php

我只是创建了一个文件夹,并在其中创建了一个名为“composer.json”的文件。在那里,我编写了如下代码。

{
    "require": {
        "php": ">=5.5.11",
        "aws/aws-sdk-php": "2.*"
    }
}

当我按下以下命令时。

curl -sS https://getcomposer.org/installer | php
php composer.phar install

我的输出如下

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
        - The requested package php could not be found in any version, there may be a typo in the package name.   Problem 2
        - The requested package php could not be found in any version, there may be a typo in the package name.   Problem 3
        - aws/aws-sdk-php 2.6.6 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.6.5 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.6.4 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.6.3 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.6.2 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.6.1 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.6.0 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.5.4 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.5.3 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.5.2 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.5.1 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.5.0 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.4.9 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.4.8 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.4.7 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.4.6 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.4.5 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.4.4 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.4.3 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.4.2 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.4.12 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.4.11 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.4.10 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.4.1 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.4.0 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.3.4 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.3.3 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.3.2 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.3.1 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.3.0 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.2.1 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.2.0 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.1.2 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.1.1 requires php >=5.3.3 -> no matching package found.
        - aws/aws-sdk-php 2.1.0 requires php >=5.3.2 -> no matching package found.
        - aws/aws-sdk-php 2.0.3 requires php >=5.3.2 -> no matching package found.
        - aws/aws-sdk-php 2.0.2 requires php >=5.3.2 -> no matching package found.
        - aws/aws-sdk-php 2.0.1 requires php >=5.3.2 -> no matching package found.
        - aws/aws-sdk-php 2.0.0 requires php >=5.3.2 -> no matching package found.
        - aws/aws-sdk-php 2.6.6 requires php >=5.3.3 -> no matching package found.
        - Installation request for aws/aws-sdk-php 2.* -> satisfiable by aws/aws-sdk-php[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.1.0, 2.1.1, 2.1.2,
    2.2.0, 2.2.1, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.4.1, 2.4.10, 2.4.11, 2.4.12, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8, 2.4.9, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.6.6].

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> for more details.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

但是当我从composer.json中删除PHP版本或AWS sdk并点击以下命令时,它工作正常。没有得到什么问题。

php composer.phar update

我在MAC系统上。

1 个答案:

答案 0 :(得分:1)

在composer.json文件中将PHP版本更改为5.3或更低,所以

...
"php": ">=5.3",
...