composer执行报错,无法连接服务器。configuration does not allow connections。 设置包下载服务器。

报错

1
2
Your configuration does not allow connections to http://packagist.org/packages.json. See https://getcomposer.org/do
c/06-config.md#secure-http for details.

修复方法:换http源,更改配置不要使用https加密连接

1
2
$ composer config -g repo.packagist composer http://packagist.phpcomposer.com
$ composer config -g secure-http false