国内镜像http://packagist.phpcomposer.com不能进行访问
2016-11-30 21:53
661 查看
最近使用composer进行php依赖管理,但是国内镜像http://packagist.phpcomposer.com不能进行访问,国外镜像访问速度也很慢
如图,系统提示我们
我们可以点击链接https://getcomposer.org/doc/06-config.md#secure-http 看看;也就是如下内容
打开命令行窗口(windows用户)或控制台(Linux、Mac 用户),进入你的项目的根目录(也就是
如图,系统提示我们
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 看看;也就是如下内容
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的。所以我们要修改一下我们的composer.json配置文件;
打开命令行窗口(windows用户)或控制台(Linux、Mac 用户),进入你的项目的根目录(也就是
composer.json文件所在目录),执行如下命令:
composer config repo.packagist composer https://packagist.phpcomposer.com[/code]
上述命令将会在当前项目中的composer.json文件的末尾自动添加镜像的配置信息(你也可以自己手工添加):"repositories": { "packagist": { "type": "composer", "url": "https://packagist.phpcomposer.com" } }
OK,一切搞定!试一下composer install来体验飞一般的速度吧!
参考链接:
https://segmentfault.com/q/1010000004517793
http://pkg.phpcomposer.com/
相关文章推荐
- Windows下用subversion进行版本控制(转载自http://luhengqi.com/read.php/23.htm)
- php composer安装 &&配置国内镜像
- 访问地图http://clustrmaps.com/zh/admin/action.php
- 解决 composer 镜像不能访问的问题
- tp3.2.3 解决http://lx.com/后必须加index.php才能访问的问题,配置文件中忘了加index index.php index.html 等默认文件
- 访问地图http://clustrmaps.com/zh/admin/action.php
- 最近docker国内的镜像dockerpool.com怎么访问不了,有兄弟知道为什么吗?
- 在使用composer下载TP5的时候遇到 Your configuration does not allow connections to http://packagist.phpcomposer.
- c++ 友元函数 还是不能访问私有成员。。 http://zhidao.baidu.com/link?url=Ccm5gZvOc733A_YsS2kj-LZsVtdwu6BT3WR97u66jZAZ1
- Composer 更换为国内镜像源(Packagist 镜像)
- composer 镜像不能访问的问题
- 本地运行FlashPlayer访问本地文件的设置 / 本地运行flash不能正常显示问题(转http://hi.baidu.com/slzs_zyt/blog/item/c8a40697aa45ac6354fb9630.html)
- Authentication required (packagist.phpcomposer.com) 账号密码到哪里获取?
- 此处blog不再维护,欢迎访问http://sycnick.spaces.live.com/
- PHP利用COM对象访问SQLServer、Access
- 请从 http://blog.thinksea.com 访问我的blog,感谢您对我的关心
- http://www.sqlet.com/blog/index.php
- 欢迎访问我的博客,留言请上http://jkflyfox.spaces.live.com
- [url=http://bbs.exue.com.cn/plugin.php?identifier=adcom&module=adcom&action=entry&id=377899]E学论坛——英语学习、考试指导、资料下载、出国留学专业论坛[/url]
- 换地方了,请访问http://www.cxyhy.com