Skip to content

Upgrading from Magen2.3.4 to 2.4.5

I am using Magento 2.3.4 now.
I want try to Magento 2.4.5. But I don’t upgrade Magento.
when run command in cpanel terminal, show error like this.

$ composer require magento/product-community-edition 2.4.5 --no-update --no-plugins
./composer.json has been updated
$ composer update
The "magento/magento-composer-installer" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composerinstallation ("2.2.0"). You may need to run composer update with the "--no-plugins" option.
The "magento/inventory-composer-installer" plugin was skipped because it requires a Plugin API version ("^1.1") that does not match your Composer installation ("2.2.0"). You may need to run composer update with the "--no-plugins" option.
The "dealerdirect/phpcodesniffer-composer-installer" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.2.0"). You may need to run composer update with the "--no-plugins" option.
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires php ~7.3.0||~7.4.0 but your php version (7.2.34) does not satisfy that requirement.
  Problem 2
    - Root composer.json requires magento/product-community-edition 2.4.5 -> satisfiable by magento/product-community-edition[2.4.5].
    - magento/product-community-edition 2.4.5 requires php ~7.4.0||~8.1.0 -> your php version (7.2.34) does not satisfy that requirement.
  Problem 3
    - 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 think must upgrade composer and from php 7.2 to 7.4.
Is right? if it’s right, how to upgrade composer?