本記事では、Composer のインストール方法をお伝えします。
Composerは、PHPのパッケージ管理ツールです。Laravel を使用するために、Composerをインストールします。
- Windows10 Home 64bit
- PHP 8.0.27
- Composer2.5.5
Composer のダウンロード
Composer を以下のサイトからダウンロードします。
上記サイトにおいて、DownLoad → Windows Installer のComposer-Setup.exeをダウンロードしました。

インストール
ダウンロードした、Composer-Setup.exeを起動します。
「Select Setup Install Mode」のダイアログが表示されたら、Install for all users を選択します。
自分しか使用しないことが決まっているなら、Install for me only でもよいと思います。

Installation Options
チェックを入れず、Nextを押します。

Settings Check
php.exeのパスを設定します。変更がなければ、Nextを押します。
すると、以下のエラーが発生しました。

Xdebug: [Step Debug] Time-out connecting to debugging client, waited: 200 ms. Tried: localhost:9003 (through xdebug.client_host/xdebug.client_port)
どうも、インストール中にXdebug が動作してしまったようです。
Visual Studio Codeで、PHP のデバッグをするために、Xdebug をインストールしました。それが悪さしているようです。
↓のサイトを参考に、php.ini にxdebug_log_level=0 を追記しました。それを行うと、先ほどのエラーは解消されました。

Proxy Setting
何もチェックせずにNextを押します。

Ready to Install
Install を押します。

php.ini のバックアップが取られるみたいで、インストール中にphp.ini を書き換えると思われます。
↓の画面が出るとインストール完了です。


動作確認
コマンドプロンプトを起動し、以下のコマンドを実行します。
$ composer -V
バージョンが表示されました。

インストールは完了です。
コメント