Pierre de LESPINAY
Pierre de LESPINAY

Reputation: 46178

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

Upvotes: 2

Views: 3397

Answers (1)

Pierre de LESPINAY
Pierre de LESPINAY

Reputation: 46178

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)

Upvotes: 8

Related Questions