世によく言われているHTTP_PROXY_REQUEST_FULLURI
の設定が異なっていて、すごくはまった。
失敗時
環境変数
HTTP_PROXY=http://proxy-host:proxy-port/
HTTP_PROXY_REQUEST_FULLURI=0
HTTPS_PROXY=http://proxy-host:proxy-port/
HTTPS_PROXY_REQUEST_FULLURI=0
composerのチェック
$ composer diagnose
Checking composer.json: OK
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.0 400 Bad Request)
Checking https connectivity to packagist: OK
Checking HTTP proxy: OK
Checking HTTP proxy support for request_fulluri: FAIL
Unable to assess the situation, maybe packagist.org is down (The "http://packagist.org/packages.json" file could not be downloaded (HTTP/1.0 400 Bad Request))
Checking HTTPS proxy support for request_fulluri: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking composer version: OK
httpsは成功するのに、httpが失敗する!
成功時
環境変数
HTTP_PROXY=http://proxy-host:proxy-port/
HTTP_PROXY_REQUEST_FULLURI=1
HTTPS_PROXY=http://proxy-host:proxy-port/
HTTPS_PROXY_REQUEST_FULLURI=0
HTTP_PROXY_REQUEST_FULLURI
をtrue
にする
composerのチェック
$ composer diagnose
Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking HTTP proxy: OK
Checking HTTP proxy support for request_fulluri: OK
Checking HTTPS proxy support for request_fulluri: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking composer version: OK
ようやくできた。