引用文章:
Composer设置国内镜像_composer 国内源-CSDN博客
php composer.phar require --prefer-dist yiidoc/yii2-redactor "*"
A connection timeout was encountered. If you intend to run Composer without connecting to the internet, run the command again prefixed with COMPOSER_DISABLE_NETWORK=1 to make Composer run in offline mode.
https://repo.packagist.org could not be fully loaded (curl error 28 while downloading https://repo.packagist.org/p2/codeception/lib-innerbrowser.json: Operation timed out after 10000 milliseconds with 0 out of 0 bytes received), package information was loaded from the local cache and may be out of date
Installation failed, reverting ./composer.json to its original content.
In CurlDownloader.php line 371:
curl error 28 while downloading https://repo.packagist.org/p2/codeception/lib-innerbrowser.json: Operation timed out after 10000 milliseconds with 0 out of 0 bytes received
解决方案:
composer config -g -l
设置阿里云镜像
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/