I’d like to upgrade magento from 2.3.4 to 2.4.3.
But I cannot upgrade it.
this is error.
Your requirements could not be resolved to an installable set of packages.
Problem 1
– Root composer.json requires magento/product-community-edition 2.4.3 -> satisfiable by magento/product-community-edition[2.4.3].
– magento/product-community-edition 2.4.3 requires php ~7.3.0||~7.4.0 -> your php version (7.2.34) does not satisfy that requirement.
Problem 2
– Root composer.json requires dealerdirect/phpcodesniffer-composer-installer ^0.5.0 -> satisfiable by dealerdirect/phpcodesniffer-composer-installer[v0.5.0].
– dealerdirect/phpcodesniffer-composer-installer v0.5.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.2.0] but it does not match the constraint.
Use the option –with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
I am using cpanel now. In cpanel I set php version is 7.4
PHP 7.4.33 (cli) (built: Nov 10 2022 11:12:07) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies
what is the reason?
2
Answers
See if you’re really using php 7.4 by typing
php -v
in the terminal. When you are sure that your php version is correct, delete the composer.lock file (make a backup beforehand). Try updating with the command:If that doesn’t work, post the contents of the composer.json file
If you are migrating from 2.3.4 to 2.4.3, you need to make the following and please follow these below steps:
1: Backup composer.json: Run the command
cp composer.json composer.json.bak
2: Upgrade your Magento: Run the commmand
3: Update the dependecies:
composer update
For example, Specify the metapackage:
Magento Open Source:
composer require-commerce magento/product-community-edition 2.4.4 --no-update
Adobe Commerce:
composer require-commerce magento/product-enterprise-edition 2.4.4 --no-update
4: Composer Update: Run
composer update
5: Update the database schema and data.
bin/magento setup:upgrade
6: Disable Magento maintenance mode.
bin/magento maintenance:disable
7: Restart Varnish. (Optional) Restart Varnish If you use it for page caching:
service varnish restart
Please switch to PHP 7.4 first then check perform the upgrade.