简体   繁体   中英

Composer telling the wrong php version

I know many people are struggling into the "composer using the wrong php version" and the solution is to call composer with the good one (currently suggested duplicate).

Here is my case:

$ php -v
PHP 5.6.31 (cli) (built: Sep  8 2017 04:36:13) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

$ php /usr/local/bin/composer update
  Problem 1
    - This package requires php >=5.6.31 but your PHP version (5.5.9)
      does not satisfy that requirement.

How can this be explained ?


For info, I'm using the official php:5.6-fpm docker image. And I installed composer with:

$ curl -sS https://getcomposer.org/installer
  | php -- --install-dir=/usr/local/bin --filename=composer

I just realized this config at the bottom of my composer.json :

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

That's the version on which it bases his warning (not the one actually used)

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