Magento – Magento 2 : Error While upgrade 2.3.0 to 2.3.1

magento2magento2.3.0magento2.3.1

I am trying to upgrade Magento version from 2.3.0 to 2.3.1 and I am using PHP 7.2 for same but while I run upgrade command getting bellow error is anyone have any idea how to fix?

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


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

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

enter image description here

Best Answer

Magento does not require PHP 7.2 since 2.3.1 release, PHP 7.1.3 and later still supported. https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html

in your case, the system has a fatal error encountering void return type https://github.com/magento-engcom/inventory-composer-installer/blob/master/src/Plugin.php#L55

Which is added since PHP 7.1 release - https://www.php.net/manual/en/migration71.new-features.php

Related Topic