4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

認証のあるプロキシ環境下でComposer installがうまく行かないときの対応方法

Posted at
  • 環境
    • Windows7 32bit
    • Composer version 1.6.5 2018-05-04 11:44:59

事象 : 認証のあるプロキシ環境下でinstallがうまくいかない

対応方法 : 環境変数にプロキシを設定する

Command-line interface / Commands - Composerによると
「環境変数でHTTP_PROXYにプロキシを設定してね。」
「プロキシがrequest_fulluriフラグをサポートしていなかったら環境変数でHTTP_PROXY_REQUEST_FULLURIHTTPS_PROXY_REQUEST_FULLURIfalse0を設定してね。」
と言っている気がします。(正確に読みたい方はサイトを見てください。)

bashを使う場合
# 1回やればOKなところ--------
$ echo "export HTTP_PROXY=http://{ユーザ名}:{パスワード}@{プロキシ}:{ポート}/" >> ~/.bash_profile
$ echo "export HTTPS_PROXY=$HTTP_PROXY" >> ~/.bash_profile
$ echo "export HTTP_PROXY_REQUEST_FULLURI=0" >> ~/.bash_profile
$ echo "export HTTPS_PROXY_REQUEST_FULLURI=$HTTP_PROXY_REQUEST_FULLURI" >> ~/.bash_profile
$ source .bash_profile
# ここまで---何度もやると.bash_profileが大変なことになる------------------
$ composer install
Windowsコマンドを使う場合
set HTTP_PROXY=http://{ユーザ名}:{パスワード}@{プロキシ}:{ポート}/
set HTTPS_PROXY=%HTTP_PROXY%
set HTTP_PROXY_REQUEST_FULLURI=0
set HTTPS_PROXY_REQUEST_FULLURI=%HTTP_PROXY_REQUEST_FULLURI%
composer install
4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?