Error : Unsupported declare strict_types
in
../vendor/magento/inventory-composer-installer
while install the extension using composer in Magento 2.3.0.
2 Answers
I had the same issue, it is due to the version of PHP you are using, and the version of PHP required for Composer.
My CLI was using PHP 5.4, but I had to run it on 7.2.
So instead of running something like:
composer upgrade
I ran:
php7.2 /path/to/composer upgrade
Hope this helps. I was confused on this for a little while, as the error doesn't seem related to the PHP version, but seems like more of a bug with the installation.
-
I just realised how old this post is (so I assume you have a solution), but I couldn't find much help related to Magento 2.3, so I hope this helps anyone else who comes across it. Commented Feb 8, 2019 at 17:02
-
-
In my case it is the multiphp had reset the php version on the composer folder, which i had to change manually with ln -s ea-php72 .ea-php-cli.cache Commented May 2, 2019 at 11:29
if you still have this problem, just change your PHP version for CLI. If you use WHH you can change it from here:
Home »Software »MultiPHP Manager»System PHP Version click edit button and choose PHP 7.2