下载Laravel时Composer HTTP 400 Bad请求

时间:2015-07-17 01:46:06

标签: php laravel composer-php packagist

我收到一个400连接http的错误请求的问题,似乎该包只想通过http安装。我尝试在composer.json中覆盖,因为其他人试图强制使用https作为解决方法 - 但这似乎不起作用。我不在防火墙后面。 Mac OS 10.10.3

问题:

composer diagnose
Checking composer.json: FAIL
the property name is required
the property description is required
No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: FAIL
[Composer\Downloader\TransportException] The "http://packagist.org/packages.json" file could not be downloaded (HTTP/1.1 400 Bad Request)
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking composer version: OK

[Composer\Downloader\TransportException]    

The "http://packagist.org/p/provider-2013$c2596c5d04e7701561420666ba120ede9429a69c75b732a5a01b18ebb3d64e53.json" file could not be downloaded (HTTP/1.1 400 Bad Request)    

Composer.json

{
"repositories": [
     { "packagist": false }
,

    {
         "type": "composer", 
         "url": "https://packagist.org"
    }
]
}

作曲家版本1.0-dev(92faf1c7a83a73794fb914a990be435e1df373ca)  2015-07-14 12:37:15

3 个答案:

答案 0 :(得分:5)

对我来说,退出Forticlient(防病毒/网络安全应用)删除了400错误请求错误并允许我通过作曲家下载laravel。

也许您有防病毒软件或类似的干扰。

我使用的是Mac OS X 10.11

答案 1 :(得分:1)

我有同样的问题,我使用composer diagnose -vvv

Checking git settings: Executing command (CWD): git config color.ui
OK
Checking http connectivity to packagist: Downloading http://packagist.org/packages.json
FAIL
[Composer\Downloader\TransportException] The "http://packagist.org/packages.json" file could not be downloaded (HTTP/1.1 400 Bad Request)

因为我安装了Forticlient,所以请停止它,一切正常。

答案 2 :(得分:0)

我在Mac OS X El Capitan 10.11.06上安装Yii2并解决如下。

在我的情况下,我必须关闭一个应用程序(防病毒/网络安全应用程序)

  

FortiClient Aplication Close

然后再次尝试制作作曲家命令

composer global require "fxp/composer-asset-plugin:^1.2.0"