文章來源:developer.aliyun.com/composer?spm=...
更多參考:docs.phpcomposer.com/
全域性配置(推薦)
所有專案都會使用該映象地址:
composer config -g repo.packagist composer mirrors.aliyun.com/composer/
取消配置:
composer config -g –unset repos.packagist
專案配置
僅修改當前工程配置,僅當前工程可使用該映象地址:
composer config repo.packagist composer mirrors.aliyun.com/composer/
取消配置:
composer config –unset repos.packagist
除錯
composer 命令增加 -vvv 可輸出詳細的資訊,命令如下:
composer -vvv require alibabacloud/sdk
遇到問題?
1. 建議先將Composer版本升級到最新:
composer self-update
2. 執行診斷命令:
composer diagnose
3. 清除快取:
composer clear
4. 若專案之前已通過其他源安裝,則需要更新 composer.lock 檔案,執行命令:
composer update –lock
本作品採用《CC 協議》,轉載必須註明作者和本文連結