cancel
Showing results for 
Search instead for 
Did you mean: 

composer issue php warnings from inventory-composer-installer/src/plugin.php

SOLVED
Highlighted

composer issue php warnings from inventory-composer-installer/src/plugin.php

Having a problem with running composer to do anything. Any time I try using composer i get php warning of unsupported declare 'strict types' and php parse error as shown in attached image. Even just trying to do composer --version

tmp70.png

I don't understand why it is trying to run something with magento when I'm trying to identify what version of composer is in use. Does it just pick up the composer.json in the magento directory?

One suggestion was my version of php is too old. but php -v indicates I'm using 7.2 although that is within magento user.

 

Any pointer would be extremely helpful. Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: composer issue php warnings from inventory-composer-installer/src/plugin.php

Hi @BTaylor351 

 

This error occurs because of multiple PHP installed on your hosting server, Try to make PHP 7.2 as default PHP version.

 

Read this blog for better understanding :

https://www.linderobrands.com/blog/unsupported-declare-strict-types/

 

If issue resolve, please click on 'Kudos' & Accept as Solution!

Problem Solved ? Click on 'Kudos' & Accept as Solution to encourage to write more answers !

View solution in original post

2 REPLIES 2
Highlighted

Re: composer issue php warnings from inventory-composer-installer/src/plugin.php

Hi @BTaylor351 

 

This error occurs because of multiple PHP installed on your hosting server, Try to make PHP 7.2 as default PHP version.

 

Read this blog for better understanding :

https://www.linderobrands.com/blog/unsupported-declare-strict-types/

 

If issue resolve, please click on 'Kudos' & Accept as Solution!

Problem Solved ? Click on 'Kudos' & Accept as Solution to encourage to write more answers !

View solution in original post

Highlighted

Re: composer issue php warnings from inventory-composer-installer/src/plugin.php

Hi @BTaylor351 

So instead of running something like:

composer upgrade

Try to run below command:

php7.2 /path/to/composer upgrade

Hope this helps. 

 

If issue resolve, please click on 'Kudos' & Accept as Solution!