最近使用composer进行php依赖管理,但是国内镜像http://packagist.phpcomposer.com不能进行访问,国外镜像访问速度很慢,请问大神还有什么其他的国内镜像或好的解决方法吗?
最近使用composer进行php依赖管理,但是国内镜像http://packagist.phpcomposer.com不能进行访问,国外镜像访问速度很慢,请问大神还有什么其他的国内镜像或好的解决方法吗?
那是因为composer默认用Https协议请求,国内镜像之前是http的,貌似现在换了
<code>your configuration does not allow to connection to `http://xxxxxxx`,see the https://getcomposer.org/doc/06-config.md#secure-http for details.</code>
打开https://getcomposer.org/doc/06-config.md#secure-http看看
<code>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.</code>
默认是必须使用https的,而你使用的镜像是http的。
也就是在,config.json中配置
<code>{
"config": {
"secure-http": false
}
}</code>另外,如果有爬墙资源的话,可以参考下这个:https://segmentfault.com/a/1190000000518008
DBShop电子商务系统具备统一的系统设置、简单的商品管理、灵活的商品标签、强大的商品属性、方便的配送费用管理、自由的客服设置、独立的广告管理、全面的邮件提醒、详细的管理权限设置、整合国内外知名支付网关、完善的系统更新(可在线自动更新或手动更新)功能、细致的帮助说明、无微不至的在线教程……,使用本系统绝对是一种享受! DBShop开源电子商务网店系统采用业界知名框架 ZendFramewor
401
我觉得吧!
还是用国外镜像好:
1、Composer从GitHub拉取代码文件,Github挂了你也用不了
2、还不如做个翻/墙。
之前在用的国内镜像:
Packagist
好像官网有说明 phpcomposer
或者将.composer/config.json修改成
<code>{
"config": [],
"repositories": {
"packagist": {
"type": "composer",
"url": "https://packagist.phpcomposer.com"
}
}
}
</code>
http://pkg.phpcomposer.com/ 这个应该好用啊 我前天还用了。。
http://pkg.phpcomposer.com/ 可以切换至中国镜像。
现在好用了,谢谢大家的帮助
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号