简体   繁体   中英

Getting error wile including PHP and AWS in composer.json

I simply created a folder and within that created a file called "composer.json". With in that I written code as following.

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

When I hit following command.

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

I am getting output as following

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.

But when I remove either PHP version or AWS sdk from composer.json and hit following command, It works fine. Not getting what is the problem.

php composer.phar update

I am on MAC system.

Change your PHP version to 5.3 or lower in your composer.json file, so

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM