今天新建laravel項目的時候,在使用composer install 配置項目相關包的時候,總是出現下面的錯誤
The "https://repo.packagist.org/p/illuminate/contracts.json" file could not be downloaded: failed to open stream: HTTP request failed!
https://packagist.phpcomposer.com could not be fully loaded, package information was loaded from the local cache and may be out of date
百度一下很多都是許久以前的,要用國內的鏡像 composer config repo.packagist composer https://packagist.phpcomposer.com
但是使用過後發現也會出問題,可能已經不好用,有限制。
下面整理出來國內的可用的鏡像
阿里雲鏡像 https://mirrors.aliyun.com/composer/
騰訊雲鏡像 https://mirrors.cloud.tencent.com/composer/
華爲雲鏡像 https://repo.huaweicloud.com/repository/php/
推薦使用阿里的 比較穩定