0

I'm trying to upgrade to Magento 2.3.1 and I'm running into a problem. I was on PHP 7.1.3 and noticed in the system requirements that it requires 7.1.3 and 7.2.X. We've upgraded the server PHP version to 7.2.16.

Running composer update after doing the other steps brings up this error:

[user@machine public_html]$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 138 installs, 163 updates, 0 removals
  - Installing magento/inventory-composer-installer (1.1.0): Loading from cache

Warning: Unsupported declare 'strict_types' in /home/site/public_html/vendor/magento/inventory-composer-installer/src/Plugin.php on line 6

Parse error: syntax error, unexpected ':', expecting ';' or '{' in /home/site/public_html/vendor/magento/inventory-composer-installer/src/Plugin.php on line 55

Running $ php -v returns this info:

[user@machine public_html]$ php -v
PHP 7.2.16 (cli) (built: Mar 25 2019 18:26:43) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

and in my composer.json I have:

... etc ...
"config": {
    "platform": {
        "php": "7.2.16"
    },
    "use-include-path": true
},
... etc ...

I've scoured the internet and it all leads back to upgrade PHP version - which ... it is. What step am I missing?

edit

question replies

Are you following the steps outlined in the Magento DevDocs or another resource? - Did you update using the Magento script at https://devdocs.magento.com/guides/v2.3/comp-mgr/cli/cli-upgrade.html#upgrade-cli-script?

following the steps for manual CLI upgrade.

Do you have a cache storage system like Redis or Memcached that needs to be cleared?

Nope.

Do you have any other errors if you disable the inventory-composer-installer module?

nope.

Are you upgrading php-fpm?

Not using it.

What version of Composer do you have after upgrading?

composer -V shows

Composer version 1.5.2 2017-09-11 16:59:25

1 Answer 1

0

Updates:

Does it show any other PHP versions if you run?
sudo update-alternatives --display php
If, so then try to set PHP manually or via a command:
sudo update-alternatives --set php /usr/bin/php7.2
or sudo update-alternatives --config php

How about trying to run something like?
php7.2 /path/to/composer upgrade

End updates

Here are a couple of troubleshooting questions that may help get you in the right direction or get more info to help you further:

Are you following the steps outlined in the Magento DevDocs or another resource? - Did you update using the Magento script at https://devdocs.magento.com/guides/v2.3/comp-mgr/cli/cli-upgrade.html#upgrade-cli-script?

Do you have a cache storage system like Redis or Memcached that needs to be cleared?

Do you have any other errors if you disable the inventory-composer-installer module?

Are you upgrading php-fpm?

What version of Composer do you have after upgrading?

Good Luck, these are some of the pain points that I had while upgrading and I hope you can get it sorted out soon.

10
  • see my q edit :)
    – treyBake
    Apr 1, 2019 at 14:04
  • Thanks for more info. I made some updates to my post as well. What hosting environment are you using?
    – Mike Dubs
    Apr 1, 2019 at 14:27
  • there are a range of others version - but, everything in WHM and cli shows php7.2 - and the php7.2 /path/to/composer upgrade returns Could not open input file: /home/virtfs/site/usr/local/bin/composer
    – treyBake
    Apr 1, 2019 at 14:34
  • Several Stack sites point to PHP version. Is there a way to confirm PHP version through WHM like: Home »Software »MultiPHP Manager»System PHP Version click edit button and choose PHP 7.2 Maybe try chatting with host support to see if they have to make any manual changes on their end. I've seen this on BlueHost before
    – Mike Dubs
    Apr 1, 2019 at 14:42
  • Yeah it says PHP7.2 and doing php -v in CLI shows version 7.2.16 - host upgraded version this morning - but the error was happening before and after update
    – treyBake
    Apr 1, 2019 at 14:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.