- You are using composer version 2.2.0, it is compatible with Magento 2.4.5.
- As you are using Magento 2.3.4, you can use PHP 7.3 or 8.1 to upgrade to Magento 2.4.5.
As you are using PHP 7.2, you have to upgrade PHP to 7.3 or 8.1 to upgrade Magento to 2.4.5.
After upgrading to Magento 2.4.5, it requires PHP 8.1.
- Magento released version 2.4.5-p1, you should upgrade Magento to that version instead of 2.4.5 to keep your site safe.
You can try one of the following solutions to upgrade your Magento site to 2.4.5-p1 (if solution 1 does not work for you, try solution 2):
Solution 1:
- Switch to PHP version 8.1.
- Update
require-dev
section in your composer.json
file same as the Magento codebase: https://github.com/magento/magento2/blob/2.4.5-p1/composer.json#L108
- Run the following commands:
rm -rf vendor
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.5-p1 --no-update
composer update
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
Solution 2:
- Switch PHP to version 7.3.
- Run the following commands:
composer require magento/composer-root-update-plugin ~2.0 --no-update
composer update
rm -rf var/cache/* var/page_cache/* generated/*
bin/magento setup:upgrade
composer require-commerce magento/product-community-edition 2.4.5-p1 --no-update
composer update
- Change to PHP version 8.1
- Run the following commands:
rm -rf var/cache/* var/page_cache/* generated/*
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
If you still can't upgrade to Magento 2.4.5 (-p1), edit your question to add the content of your composer.json, I'll help you resolve it.
=== UPDATE ===
As you now want to upgrade to Magento 2.4.3, based on your composer.json, I've modified your composer.json to support upgrading to Magento 2.4.3-p3.
Update your composer.json with the following content:
{
"name": "magento/project-community-edition",
"description": "eCommerce Platform for Growth (Community Edition)",
"type": "project",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"config": {
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"magento/*": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"laminas/laminas-dependency-plugin": true
}
},
"require": {
"magento/composer-dependency-version-audit-plugin": "~0.1",
"magento/composer-root-update-plugin": "~2.0",
"magento/data-migration-tool": "2.4.3",
"magento/product-community-edition": "2.4.3-p3",
"laminas/laminas-serializer": "^2.10",
"addressfinder/module-magento2": "~2.0",
"stripe/stripe-php": "^7.27"
},
"require-dev": {
"allure-framework/allure-phpunit": "~1.4",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"friendsofphp/php-cs-fixer": "~2.18.1",
"lusitanian/oauth": "~0.8.10",
"magento/magento-coding-standard": "*",
"magento/magento2-functional-testing-framework": "^3.0",
"pdepend/pdepend": "~2.7.1",
"phpcompatibility/php-compatibility": "^9.3",
"phpmd/phpmd": "^2.8.0",
"phpstan/phpstan": "^0.12.77",
"phpunit/phpunit": "^9",
"sebastian/phpcpd": "^6.0.3",
"squizlabs/php_codesniffer": "~3.5.4",
"symfony/finder": "^5.2"
},
"conflict": {
"gene/bluefoot": "*"
},
"autoload": {
"psr-4": {
"Magento\\Framework\\": "lib/internal/Magento/Framework/",
"Magento\\Setup\\": "setup/src/Magento/Setup/",
"Magento\\": "app/code/Magento/",
"Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"
},
"psr-0": {
"": [
"app/code/",
"generated/code/"
]
},
"files": [
"app/etc/NonComposerComponentRegistration.php"
],
"exclude-from-classmap": [
"**/dev/**",
"**/update/**",
"**/Test/**"
]
},
"autoload-dev": {
"psr-4": {
"Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
"Magento\\Tools\\": "dev/tools/Magento/Tools/",
"Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
"Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
"Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
}
},
"version": "2.4.3-p3",
"minimum-stability": "stable",
"repositories": {
"0": {
"type": "composer",
"url": "https://repo.magento.com/"
},
"amasty": {
"type": "composer",
"url": "https://composer.amasty.com/community/"
}
},
"extra": {
"magento-force": "override"
}
}
Then run composer update
to upgrade to Magento 2.4.3-p3 and run the following commands to finish upgrade:
rm -rf var/cache/* var/page_cache/* generated/*
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
=== UPDATE ===
As you now want to upgrade to Magento 2.4.5-p1, based on your composer.json, I've modified your composer.json to support upgrading to Magento 2.4.5-p1.
Update your composer.json with the following content:
{
"name": "magento/project-community-edition",
"description": "eCommerce Platform for Growth (Community Edition)",
"type": "project",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"config": {
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"magento/*": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"laminas/laminas-dependency-plugin": true
}
},
"require": {
"magento/composer-root-update-plugin": "~2.0",
"magento/data-migration-tool": "2.4.5",
"magento/product-community-edition": "2.4.5-p1",
"addressfinder/module-magento2": "~2.0",
"stripe/stripe-php": "^7.27"
},
"require-dev": {
"allure-framework/allure-phpunit": "~1.5.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.2",
"friendsofphp/php-cs-fixer": "~3.4.0",
"lusitanian/oauth": "~0.8.10",
"magento/magento-coding-standard": "*",
"magento/magento2-functional-testing-framework": "^3.7",
"pdepend/pdepend": "~2.10.0",
"phpmd/phpmd": "^2.12.0",
"phpstan/phpstan": "^1.6.8",
"phpunit/phpunit": "~9.5.20",
"sebastian/phpcpd": "^6.0.3",
"squizlabs/php_codesniffer": "~3.6.0",
"symfony/finder": "^5.2"
},
"conflict": {
"gene/bluefoot": "*"
},
"autoload": {
"psr-4": {
"Magento\\": "app/code/Magento/",
"Magento\\Framework\\": "lib/internal/Magento/Framework/",
"Magento\\Setup\\": "setup/src/Magento/Setup/"
},
"psr-0": {
"": [
"app/code/",
"generated/code/"
]
},
"files": [
"app/etc/NonComposerComponentRegistration.php"
],
"exclude-from-classmap": [
"**/dev/**",
"**/update/**",
"**/Test/**"
]
},
"autoload-dev": {
"psr-4": {
"Magento\\PhpStan\\": "dev/tests/static/framework/Magento/PhpStan/",
"Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
"Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
"Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/",
"Magento\\Tools\\": "dev/tools/Magento/Tools/",
"Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/"
}
},
"version": "2.4.5-p1",
"minimum-stability": "stable",
"repositories": {
"0": {
"type": "composer",
"url": "https://repo.magento.com/"
},
"amasty": {
"type": "composer",
"url": "https://composer.amasty.com/community/"
}
},
"extra": {
"magento-force": "override"
}
}
Then run composer update
to upgrade to Magento 2.4.5-p1
And run the following commands to finish upgrade:
rm -rf var/cache/* var/page_cache/* generated/*
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f