簡體   English   中英

magento 從 2.3.4 升級到 2.4.3 時如何解決問題?

[英]how to fix issue when magento upgrade from 2.3.4 to 2.4.3?

我想將 magento 從 2.3.4 升級到 2.4.3。 但我無法升級它。 這是錯誤。

您的要求無法解析為一組可安裝的軟件包。

問題 1 - Root composer.json 需要 magento/product-community-edition 2.4.3 -> 可由 magento/product-community-edition[2.4.3] 滿足。 - magento/product-community-edition 2.4.3 需要 php ~7.3.0||~7.4.0 -> 您的 php 版本 (7.2.34) 不滿足該要求。 問題 2 - Root composer.json 需要 dealerdirect/phpcodesniffer-composer-installer ^0.5.0 -> dealerdirect/phpcodesniffer-composer-installer [v0.5.0] 可滿足。 - dealerdirect/phpcodesniffer-composer-installer v0.5.0 需要 composer-plugin-api ^1.0 -> 找到 composer-plugin-api[2.2.0] 但它與約束不匹配。

使用選項 --with-all-dependencies (-W) 允許升級、降級和刪除當前鎖定到特定版本的包。

我現在正在使用 cpanel。 在 cpanel 我設置 php 版本是 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), 由 Zend Technologies 提供

是什么原因?

通過在終端中輸入php -v來查看您是否真的在使用 php 7.4。 當你確定你的php版本正確后,刪除composer。 鎖定文件(事先做好備份)。 嘗試使用以下命令更新:

作曲家需要 magento/product-community-edition:2.4.5 -W

如果這不起作用,請發布作曲家的內容。 json檔案

如果您要從 2.3.4 遷移到 2.4.3,則需要執行以下操作,請按照以下步驟操作:

1:備份composer.json:運行命令

cp composer.json composer.json.bak

2:升級你的Magento:運行命令

composer require-commerce magento/<product> <version> --no-update [--interactive-root-conflicts] [--force-root-updates] [--help]

3:更新依賴:

作曲家更新

例如,指定元數據包:

Magento 開源: 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

5:更新數據庫架構和數據。 bin/magento setup:upgrade

6:禁用Magento維護模式。 bin/magento maintenance:disable

7:重啟清漆。 (可選)重啟 Varnish 如果你用它來做頁面緩存: service varnish restart

請先切換到PHP 7.4,然后檢查執行升級。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM