Search code examples
phpwindowssymfonyhwioauthbundle

installing HWIOAuthBundle via composer exception about wrong php version


Hi I want install to project on symfony HWIOAuthBundle

My PHP version (in CLI): 7.1.11 Symfony version: 2.8.31

but after running command:

composer require hwi/oauth-bundle php-http/guzzle6-adapter php-http/httplug-bundle

i get this exception:

[InvalidArgumentException] Could not find package php-http/guzzle6-adapter at any version matching you r PHP version 5.3.9.0

I was updated php before i had 5.3.9 but if i run command php -v i see right version 7.1.11 in CLI and on web (debug symfony bar) is again 7.1.11 version. Php path in enviroment variables was not change - new php is in same directory. And old php dir was renamed.


Solution

  • You should add the platform config in you composer.json:

    "config": { "platform": { "php": "7.1.11" } },

    https://getcomposer.org/doc/06-config.md#platform