2
0

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 1 year has passed since last update.

AWS EC2 AmazonLinux2 composerをバージョンを指定してインストールする

Last updated at Posted at 2022-03-07

概要

  • EC2のAmazonLinux2インスタンスにcomposerを入れて$ composerコマンドを実行できるようにする。

前提

方法

  1. 下記コマンドを実行してcomposerの2.2.6バージョンを指定してインストールする。

    $ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
    $ php composer-setup.php --version=2.2.6
    $ php -r "unlink('composer-setup.php');"
    $ sudo mv composer.phar /usr/local/bin/composer
    
  2. 下記コマンドを実行してパスを通す。

    $ echo "export PATH=~/.config/composer/vendor/bin:$PATH" >> ~/.bash_profile
    $ source ~/.bash_profile
    
  3. 下記コマンドを実行してエラーが出なければ問題なくインストールできている。

    $ composer -v
       ______
      / ____/___  ____ ___  ____  ____  ________  _____
     / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
    / /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
    \____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                        /_/
    Composer version 2.2.6 2022-02-04 17:00:38
    
2
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?