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?
See if you're really using php 7.4 by typing
php -vin 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