Help us understand the problem. What is going on with this article?

[PHP] composerのPROXY設定

More than 5 years have passed since last update.

世によく言われている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_FULLURItrueにする

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

ようやくできた。

pb_tmz08
Perl 生まれ。Linux育ち。今は、MySQLとPHPとJavaScript、FFmpegとかで遊んでいます。デザイン以外なんでもやる係。2016年からangular使い。
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした