4

I am getting an issue of 400 bad request connecting over http, and it seems the package only wants to be installed via http. I tried an override in composer.json as tried by others as workaround to force https - but that doesn't seem to work. I'm not behind a firewall. Mac OS 10.10.3

Issue :

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"
    }
]
}

Composer version 1.0-dev (92faf1c7a83a73794fb914a990be435e1df373ca) 2015-07-14 12:37:15

  • Can you post output for `cat composer.json` and your current composer version ? – alariva Jul 17 '15 at 01:59
  • `curl -IL http://packagist.org/p/provid...` works for both `http` and `https` from my local. What do you get via curl? – here Jul 17 '15 at 02:05
  • Yes Curl works for http HTTP/1.1 200 OK Server: nginx Date: Fri, 17 Jul 2015 02:09:24 GMT Content-Type: application/json Content-Length: 1072 Last-Modified: Fri, 17 Jul 2015 02:09:14 GMT Connection: keep-alive ETag: "55a863ca-430" Accept-Ranges: bytes – David Blackwell Jul 17 '15 at 02:07
  • Did you do any change to your composer.json? Could you post last changes registered with get? Please provide the meaningful file contents by editing your question instead of posting hard to read comments. – alariva Jul 17 '15 at 02:07
  • basically composer.json was blank when I started, then I added the https option – David Blackwell Jul 17 '15 at 02:10

3 Answers3

5

For me quitting Forticlient (antivirus/web security app) removed the 400 bad request error and allowed me to download laravel via composer.

Maybe you have antivirus software or similar that is interfering.

I'm on Mac OS X 10.11

Doug Amos
  • 4,243
  • 1
  • 22
  • 23
1

I have same problem and I use 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)

Because I install Forticlient, stop it and everything work fine.

Chris Yang
  • 11
  • 2
0

I am installing Yii2 on my Mac OS X El Capitan 10.11.06 and resolved as follows.

In my case I had to close an application (antivirus/web security app)

FortiClient Aplication Close

Then try again to make the composer command

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