Google-api-php-client: Cannot install using composer: guzzlehttp/psr7 version is too high!

Created on 6 Apr 2018  路  6Comments  路  Source: googleapis/google-api-php-client

Hello,

I want to install this api client, but I get error from composer that the currently installed guzzlehttp/psr7 version is 1.4.1 and it's too high. (This version is needed for amazon web services, which I also installed previously), and you require v. 1.2.* of this dependency, not higher.

What to do? How to install it?

Thank you

question

Most helpful comment

Hello!
We require ^1.2, which actually includes 1.4.1 (the required version for php-aws). The caret in front of 1.2 indicates we support anything >=1.2 and <2.0.

Try adding this library to composer.json and then running composer update. This will successfully update to the appropriate versions. Do not follow @mattwhisenhunt's instructions of downloading all the dependencies, as this could result in some unintended issues.

The following also worked for me:

composer require google/apiclient
composer require aws/aws-sdk-php

This resulted in the following composer.json:

{
    "require": {
        "google/apiclient": "^2.2",
        "aws/aws-sdk-php": "^3.54"
    }
}

All 6 comments

We offer a release with all the dependencies included so you don't need to run composer:
https://github.com/google/google-api-php-client/releases

Hi,

And how can I install it into my project? I use composer for adding all libraries into my project.

Will I have two versions of guzzlehttp/psr7 after this installation?

Thanks

I don't know much about Composer. When I did a composer install (looks like on Mar 9th) it pulled down guzzlehttp/psr7 1.4.2 what version of google/apiclient is installed?

Hello!
We require ^1.2, which actually includes 1.4.1 (the required version for php-aws). The caret in front of 1.2 indicates we support anything >=1.2 and <2.0.

Try adding this library to composer.json and then running composer update. This will successfully update to the appropriate versions. Do not follow @mattwhisenhunt's instructions of downloading all the dependencies, as this could result in some unintended issues.

The following also worked for me:

composer require google/apiclient
composer require aws/aws-sdk-php

This resulted in the following composer.json:

{
    "require": {
        "google/apiclient": "^2.2",
        "aws/aws-sdk-php": "^3.54"
    }
}

Thanks @bshaffer i did run the same command on live server and it seems to work properly (at least installation was successful). Maybe something was messed up on my local dev pc before...

This issue looks resolved. Add a comment if that is not the case.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mevsme picture mevsme  路  4Comments

usamamashkoor picture usamamashkoor  路  5Comments

Fredyy90 picture Fredyy90  路  3Comments

artemiusgreat picture artemiusgreat  路  3Comments

kungufli picture kungufli  路  3Comments