"리눅스 composer 설치"의 두 판 사이의 차이

 
(사용자 4명의 중간 판 41개는 보이지 않습니다)
2번째 줄: 2번째 줄:
;컴포저 설치
;컴포저 설치


==방법==
==사전작업==
<source lang='cli'>
* [[리눅스 php 설치]]
[root@zetawiki ~]# curl -sS https://getcomposer.org/installer | php
#!/usr/bin/env php
Some settings on your machine may cause stability issues with Composer.
If you encounter issues, try to change the following:


Your PHP (5.3.3) is quite old, upgrading to PHP 5.3.4 or higher is recommended.
== 설치 ==
Composer works with 5.3.2+ for most people, but there might be edge case issues.
<syntaxhighlight lang='bash'>
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
composer -V
</syntaxhighlight>


<syntaxhighlight lang='console'>
root@zetawiki:~# curl -sS https://getcomposer.org/installer | php
All settings correct for using Composer
Downloading...
Downloading...


Composer successfully installed to: /root/composer.phar
Composer (version 1.4.1) successfully installed to: /root/composer.phar
Use it: php composer.phar
Use it: php composer.phar
</source>
</syntaxhighlight>
:→ 여기까지 하면 해당 폴더 내에서 <code>php composer.phar install</code> 방식으로 사용 가능
 
==(Optional) 오류시 조치==
* 여기서 composer를 배치한 폴더는 보통 다음과 같이 PATH로 잡혀 있다.
<syntaxhighlight lang='console'>
root@zetawiki:~# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
</syntaxhighlight>
* 만약 composer -V를 했을 때 command not found 에러가 뜨면 다음과 PATH 지정을 해주자<ref>또는 PATH가 잡혀 있는 다른 곳으로 옮겨도 상관없다.</ref>
<syntaxhighlight lang='console'>
root@zetawiki:~# PATH=$PATH:/usr/local/bin/
</syntaxhighlight>
 
==(Optional) root 경고메시지 해제==
{{참고|Composer root 경고메시지 해제}}
<syntaxhighlight lang='console'>
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
</syntaxhighlight>
<syntaxhighlight lang='console'>
root@zetawiki:~# export COMPOSER_ALLOW_SUPERUSER=1
root@zetawiki:~# composer -V
Composer version 1.4.1 2017-03-10 09:29:45
</syntaxhighlight>
:→ 현재 세션에 적용됨
<syntaxhighlight lang='console'>
root@zetawiki:~# echo "export COMPOSER_ALLOW_SUPERUSER=1" >> ~/.bashrc
root@zetawiki:~# cat ~/.bashrc | grep export
export COMPOSER_ALLOW_SUPERUSER=1
</syntaxhighlight>
:→ [[.bashrc]]에 등록하면 다음번 SSH 접속시부터 적용됨 (즉, 영구 적용)<ref>root를 포함하여 전체 계정에 적용하려면 [[/etc/profile]]에 등록</ref>


==같이 보기==
==같이 보기==
*[[Composer]]
* [[.phar]]
* [[PEAR 설치]]
* [[composer]]
* [[composer 업데이트]]
* [[composer 버전 확인]]
* [[composer 다운그레이드]]
* [[composer 특정버전 설치]]
* [[composer root 경고메시지 해제]]


==참고 자료==
==참고==
*https://getcomposer.org/doc/00-intro.md
* https://getcomposer.org/doc/00-intro.md


[[분류: Composer]]
[[분류: Composer]]
[[분류: /usr/local/bin]]
[[분류: 설치]]
[[분류: 설치]]

2021년 3월 13일 (토) 15:14 기준 최신판

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 }}