I recently hit an issue updating Magento v.2.1.9 to 2.2.0 via composer. Magento 2.2.0 brought lots of bug fixes as well as a move to PHP 7.1.0 which reportedly gave a 30% speed increase.
The php version was updated to 7.1 via the Control Panel, but I was still getting an error preventing me from starting the upgrade,
I read that this might be a cron issue, but manually running the Magento cron scripts didn’t fix the issue.
Error
============================================================
php composer.phar update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
– Installation request for magento/product-community-edition 2.2.0 -> satisfiable by magento/product-community-edition[2.2.0].
– magento/product-community-edition 2.2.0 requires php 7.0.2|7.0.4|~7.0.6|~7.1.0 -> your PHP version (5.6.31) does not satisfy that requirement.
============================================================
The front end would also break as Magento 2.1.9 doesn’t work for php7.1.0 (although the site was not yet live).
Solution – your PHP version (5.6.31) does not satisfy that requirement
As the server supported multiple PHP versions, I needed to change my SSH commands to run the script in PHP7.1.0.
I was executing the update script using PHP 5.6.
php composer.phar update
Run the update script in Composer using PHP 7
In order to run the update script in Composer using PHP 7, I needed the following command instead:
php7.cli composer.phar update
All my commands run via Composer in SSH, now would need php7.cli.
php7.cli bin/magento setup:upgrade
php7.cli -dmemory_limit=6G bin/magento deploy:mode:set production -s
php7.cli -dmemory_limit=6G bin/magento setup:di:compilephp7.cli bin/magento setup:static-content:deploy en_US en_GB
php7.cli bin/magento indexer:reindex
php7.cli bin/magento cache:clean
php7.cli bin/magento cache:enable