리눅스 composer 설치

(우분투 composer 설치에서 넘어옴)
Composer 설치
컴포저 설치

1 사전작업[ | ]

2 설치[ | ]

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
composer -V
root@zetawiki:~# curl -sS https://getcomposer.org/installer | php
All settings correct for using Composer
Downloading...

Composer (version 1.4.1) successfully installed to: /root/composer.phar
Use it: php composer.phar
→ 여기까지 하면 해당 폴더 내에서 php composer.phar install 방식으로 사용 가능

3 (Optional) 오류시 조치[ | ]

  • 여기서 composer를 배치한 폴더는 보통 다음과 같이 PATH로 잡혀 있다.
root@zetawiki:~# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
  • 만약 composer -V를 했을 때 command not found 에러가 뜨면 다음과 PATH 지정을 해주자[1]
root@zetawiki:~# PATH=$PATH:/usr/local/bin/

4 (Optional) root 경고메시지 해제[ | ]

root@zetawiki:~# composer -V
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Composer version 1.4.1 2017-03-10 09:29:45
root@zetawiki:~# export COMPOSER_ALLOW_SUPERUSER=1
root@zetawiki:~# composer -V
Composer version 1.4.1 2017-03-10 09:29:45
→ 현재 세션에 적용됨
root@zetawiki:~# echo "export COMPOSER_ALLOW_SUPERUSER=1" >> ~/.bashrc
root@zetawiki:~# cat ~/.bashrc | grep export
export COMPOSER_ALLOW_SUPERUSER=1
.bashrc에 등록하면 다음번 SSH 접속시부터 적용됨 (즉, 영구 적용)[2]

5 같이 보기[ | ]

6 참고[ | ]

  1. 또는 PATH가 잡혀 있는 다른 곳으로 옮겨도 상관없다.
  2. root를 포함하여 전체 계정에 적용하려면 /etc/profile에 등록
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}