- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!