最近使用composer进行php依赖管理,但是国内镜像http://packagist.phpcomposer.com不能进行访问,国外镜像访问速度很慢,请问大神还有什么其他的国内镜像或好的解决方法吗?
大家讲道理2017-04-10 17:02:27
your configuration does not allow to connection to `http://xxxxxxx`,see the https://getcomposer.org/doc/06-config.md#secure-http for details.
打开https://getcomposer.org/doc/06-config.md#secure-http
看看
secure-http#
Defaults to true. If set to true only HTTPS URLs are allowed to be downloaded via Composer. If you really absolutely need HTTP access to something then you can disable it, but using Let's Encrypt to get a free SSL certificate is generally a better alternative.
默认是必须使用https的,而你使用的镜像是http的。
也就是在,config.json中配置
{
"config": {
"secure-http": false
}
}
另外,如果有爬墙资源的话,可以参考下这个:https://segmentfault.com/a/1190000000518008
怪我咯2017-04-10 17:02:27
好像官网有说明 phpcomposer
或者将.composer/config.json修改成
{
"config": [],
"repositories": {
"packagist": {
"type": "composer",
"url": "https://packagist.phpcomposer.com"
}
}
}