composer 下载报错

  [Composer\Downloader\TransportException]
  Your configuration does not allow connections to http://pkg.phpcomposer.com/repo/packagist/packages.json. See https://getcomposer
  .org/doc/06-config.md#secure-http for details.

create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL
] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-inst
all] [--ignore-platform-reqs] [--] [] [] []

解决方法

1. 把默认的 secure-http 改成false

composer config -g secure-http false

2. 修改配置文件

#修改全局文件(推荐)
composer config -g repo.packagist composer https://packagist.phpcomposer.com

#修改当前配置文件
composer config repo.packagist composer https://packagist.phpcomposer.com

修改后

composer.json文件

{
    "repositories": {
        "packagist": {
            "type": "composer",
            "url": "https://packagist.phpcomposer.com"
        }
    }
}

本文转载于 详情请看http://www.cloudxns.net/Support/detail/id/2703.html

你可能感兴趣的:(php)