有时候composer install/update的时候会报错或者出现一些不和谐的提示如下面这样:

  1. Downloading: Connecting... Downloading: Connecting... Downloading: Connecting... Failed to download gregwar/captcha from dist: Your configuration does not allow connection to http://packagist.phpcomposer.com. See https://getcomposer.org/doc/06-config.md#secure-http for details.
  2. Now trying to download from source

PS:本人使用的是国内镜像,配置了全局使用:

  1. composer config -g repo.packagist composer https://packagist.phpcomposer.com

问题解决方法:

设置一个本地或全局的composer配置即可解决:

当前本地项目设置:

  1. composer config secure-http false

全局设置:

  1. composer config -g secure-http false

意思是默认禁用https请求,就可以了

参考文章:
http://blog.csdn.net/ownfire/article/details/50923619
http://pkg.phpcomposer.com/