Magento Update Error – Framework 102.0.5 Requires PHP ~7.1.3||~7.2.0||~7.3.0

composermagento2.3magento2.4

Magento 2.3.5

I am trying to update from Magento 2.3.5 to Magento 2.4.4-p2. The commands I executed are:

composer require magento/product-community-edition=2.4.4-p2 --no-update --use-default-magento-values
composer update

I am running PHP 7.4 and the error I get is: magento/framework 102.0.5 requires php ~7.1.3||~7.2.0||~7.3.0 -> your PHP version (7.4.30) does not satisfy that requirement.

Switching back to PHP 7.3 gives me: magento/product-community-edition 2.4.4-p2 requires php ~7.4.0||~8.1.0 -> your PHP version (7.3.33) does not satisfy that requirement.

How would I solve this?

Thanks!

Best Answer

You can apply one of 2 solutions below:

Solution 1: Firstly, switch to PHP 8.1, then update the composer.json file specifically the require-dev section with what is written here https://github.com/magento/magento2/blob/2.4.4-p2/composer.json

Then remove vendor folder and run the following commands:

composer remove magento/product-community-edition --no-update
composer require magento/composer-root-update-plugin ~2.0 --no-update
composer require-commerce magento/product-community-edition 2.4.4-p2 --no-update
composer update
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f

Solution2: Do the following steps:

  1. STAY IN PHP 7.3 (or PHP 7.4)
  2. composer require magento/composer-root-update-plugin ~2.0 --no-update
  3. composer update
  4. rm -rf var/cache/* var/page_cache/* generated/code/* ; bin/magento setup:upgrade
  5. composer require-commerce magento/product-community-edition 2.4.4-p2 --no-update
  6. composer update
  7. CHANGE TO PHP 8.1
  8. rm -rf var/cache/* var/page_cache/* generated/code/* ; bin/magento setup:upgrade; bin/magento setup:di:compile; bin/magento setup:static-content:deploy -f

Reference: https://github.com/magento/magento2/issues/35306

Related Topic