2
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をProxy環境下で使えるようにする

Last updated at Posted at 2018-09-26

Composerをインストール

Composerのサイトからダウンロードする。
今回はインストーラを使わないのでManual Downloadからcomposer.phar最新版を取得して、ダウンロードしたcomposer.pharD:\php-7.2.10\に配置する。

環境変数を設定するバッチを作成

D:\php-7.2.10\comporser.batを配置する。

composer.bat
@ECHO OFF
set PATH=D:\php-7.2.10
set TEMP=D:\php-7.2.10\temp
set COMPOSER_HOME=D:\php-7.2.10
set HTTP_PROXY=http://<user>:<password>@<proxy>:<port>/
set HTTPS_PROXY=%HTTP_PROXY%
set HTTP_PROXY_REQUEST_FULLURI=0
set HTTPS_PROXY_REQUEST_FULLURI=%HTTP_PROXY_REQUEST_FULLURI%
setlocal DISABLEDELAYEDEXPANSION
%PATH%\php "%COMPOSER_HOME%\composer.phar" %*

コマンドラインからComposerを実行

D:\php-7.2.10\composer.bat --version
Composer version 1.7.2 2018-08-01 12:00:00

Composerのバージョンが表示されれば完了!

2
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
2
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?