在使用
Windows 下使用
Composer 安装
Yii 的时候提示错误:
[Composer\Downloader\TransportException]
Your configuration does not allow connections to http://packagist.org/packages.json. See https://getcomposer.org/doc/06-config.md#secure-http for details.
解决办法:
首先设置
Composer 的
Packagist 镜像为中国镜像,全局设置,运行代码;
composer config -g repo.packagist composer https://packagist.phpcomposer.com
上面这个国内镜像已经不好使了,推荐使用下面两个:
来自 https://php.cnpkg.org/
composer config -g repos.packagist composer https://php.cnpkg.org
来自 Laravel China
composer config -g repo.packagist composer https://packagist.laravel-china.org
然后把默认的 secure-http 改成false;运行代码;
composer config -g secure-http false
这样就可以在墙内使用
Composer 快速的使用国内镜像安装你需要的项目了以及
intall 需要的依赖包。