安裝Channel Manager
檢閱需求,並收集必要的資訊,然後再安裝Channel Manager。
安裝擴充功能
Channel Manager的安裝指示取決於Adobe Commerce或Magento Open Source是部署在內部部署還是部署在雲端基礎結構上。
這兩種方法都需要您使用命令列介面(CLI)。
安裝在內部部署執行個體上
使用這些指示在Adobe Commerce上安裝Channel Manager並Magento Open Source到內部部署執行個體。
-
將您的網站置於維護模式。
code language-bash $ bin/magento maintenance:enable
-
從Commerce專案根目錄,將頻道管理員新增至
composer.json
。code language-bash composer require magento/channel-manager --no-update
-
如果出現提示,請輸入您Commerce帳戶的存取金鑰。
您的公開金鑰是您的使用者名稱;您的私密金鑰是您的密碼。
-
更新相依性並安裝擴充功能。
code language-bash composer update magento/channel-manager
composer update
命令只會更新Channel Manager所需的相依性。 若要更新所有相依性,請改用此命令:composer update
。 -
等待Composer完成更新專案相依性並解決任何錯誤。
-
驗證模組安裝:
-
檢查模組狀態。
code language-bash bin/magento module:status Magento_SalesChannels
範例回應:
code language-none Module is enabled
-
如果未啟用此模組,請啟用它。
code language-bash bin/magento module:enable Magento_SalesChannels
-
-
註冊擴充功能。
code language-bash bin/magento setup:upgrade
-
如果出現提示,請重新編譯您的Commerce專案。
code language-bash bin/magento setup:di:compile
-
清除快取。
code language-bash bin/magento cache:clean
-
停用維護模式。
code language-bash bin/magento maintenance:disable
在雲端基礎結構執行個體上的Adobe Commerce上安裝
將擴充功能新增至雲端例項時,請在開發分支中工作。
如需使用分支的協助,請參閱 雲端基礎結構上的Commerce指南 中的開始建立分支。
在安裝期間,擴充功能名稱(magento\channel-manager
)會自動插入app/etc/config.php檔案。 您不需要直接編輯檔案。
-
在本機工作站上,變更至雲端專案根目錄。
-
建立或簽出開發分支。
-
使用撰寫器名稱,將副檔名新增至
composer.json
檔案的require
區段。code language-bash composer require magento/module-sales-channels-extension --no-update
-
更新相依性並安裝擴充功能。
code language-bash composer update magento/module-sales-channels-extension
composer update
命令只會更新Channel Manager所需的相依性。 若要更新所有相依性,請改用此命令:composer update
。 -
新增、認可及推播程式碼變更 — 包含對
composer.lock
和composer.json
檔案的變更。code language-bash $ git add -A
code language-bash $ git commit -m "Install channel manager extension"
code language-bash $ git push origin <branch-name>
-
建置和部署程式完成後,請使用SSH登入遠端環境,並確認擴充功能是否已正確安裝。
bin/magento module:status Magento_SalesChannels
範例回應:
Module is enabled
如果模組已停用,請在本機環境中啟用它,並部署您的變更。
-
成功安裝擴充功能後,請登入Admin以設定Commerce服務聯結器。
note note NOTE 如需將Channel Manager更新為新版本的指示,請參閱升級模組與擴充功能。
疑難排解
使用下列資訊來解決Channel Manager安裝過程中發生的錯誤。
不正確的撰寫器索引鍵
如果用於驗證撰寫器存放庫的存取金鑰無效,或未連結至用於註冊Channel Manager服務的MAGE ID,則會顯示下列錯誤。
Could not find a matching version of package magento/channel-manager. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (stable).
檢查金鑰組態:
-
尋找
auth.json
檔案的位置:code language-bash $ composer config –global home
-
檢視
auth.json
檔案。code language-bash $ cat /path/to/auth.json
-
請確認auth.json中的認證符合用來註冊Channel Manager服務的MAGE ID🔗所關聯的金鑰。
PHP的記憶體不足
如果系統沒有為PHP分配足夠的記憶體,則會顯示以下錯誤。
Fatal error: Allowed memory size of 2146435072 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52
請使用下列其中一種方法來解決記憶體問題:
-
增加環境
php.ini
檔案中PHP的記憶體限制。 此外,請確認Commerce執行個體具有其他PHP設定的建議值。 -
從命令列指定記憶體限制。
code language-bash $ php -d memory_limit=-1 \[path to composer]/composer require magento/payment-services.
例如:
code language-bash $ php-d memory_limit=-1 vendor/bin/composer require magento/channel-manager
缺少檢視
如果在頻道管理員安裝期間發生有關遺失process_catalog_exporter_view
的錯誤,請嘗試重新整理索引子。
php bin/magento indexer:refresh
雲端部署錯誤
如需將擴充功能部署至雲端時發生的問題,請參閱擴充功能部署失敗。