php 没有中国镜像,composer国内镜像不能使用

最近使用composer进行php依赖管理,但是国内镜像http://packagist.phpcomposer.com不能进行访问,国外镜像访问速度很慢,请问大神还有什么其他的国内镜像或好的解决方法吗?

bVs7rJ

回复内容:

最近使用composer进行php依赖管理,但是国内镜像http://packagist.phpcomposer.com不能进行访问,国外镜像访问速度很慢,请问大神还有什么其他的国内镜像或好的解决方法吗?

bVs7rJ

那是因为composer默认用Https协议请求,国内镜像之前是http的,貌似现在换了

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

我觉得吧!

还是用国外镜像好:

1、Composer从GitHub拉取代码文件,Github挂了你也用不了

2、还不如做个翻/墙。

之前在用的国内镜像:

Packagist

好像官网有说明 phpcomposer

或者将.composer/config.json修改成

{

"config": [],

"repositories": {

"packagist": {

"type": "composer",

"url": "https://packagist.phpcomposer.com"

}

}

}

http://pkg.phpcomposer.com/ 这个应该好用啊 我前天还用了。。

http://pkg.phpcomposer.com/ 可以切换至中国镜像。

现在好用了,谢谢大家的帮助

本文原创发布php中文网,转载请注明出处,感谢您的尊重!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值