티스토리 뷰

반응형

요즘 뭐만 하면 컴포저(Composer)로 설치해야하는데 컴포저를 모르면 여러가지로 불편한 것 같습니다.
이번에는 우분투(Ubuntu) 서버에 컴포저를 설치해보겠습니다.

Composer 설치에 앞서

가상서버는 iwinv.kr에서 생성했습니다.
작성속도를 높이기 위해 모든 문장에 높임법을 사용하지 않겠습니다. (여기부터 시작)
본인도 초보라 문제 해결 능력은 떨어지지만 앞으로 자주하게 될 것 같아 여기에 기록한다.

먼저 서버는 저번에 작성한 포스팅을 토대로 iwinv에서 서버 생성 후 APMariaDB로 설치했다.
최근 iwinv에서 뭔가 큰 사고가 있었다는데 (잘 모름) 그래도 iwinv가 가성비가 좋은 것은 어쩔 수 없다 (고 한다..)

 

https://heavening.tistory.com/88

 

우분투 ubuntu 20.04 LTS APM(Apache2 + PHP8 + MariaDB) 설치

APM 설치에 앞서 서버는 AWS를 사용했으며, 이 것을 기준으로 기록합니다. (다른 클라우드를 사용하시는 분들께는 죄송합니다.) 또한 작성의 속도를 높이기 위해 모든 문장에 높임법을 사용하지

heavening.tistory.com

하기의 모든 명령어는 sudo su를 실행 후 입력하는 것을 기본으로 한다.
iwinv의 경우 별도 작업없이 서버 생성 후 메일로 온 비밀번호를 사용하여 로그인 하면 루트 권한이므로 이 작업은 안해도 된다.

ubuntu@ip-000-000-000-000:~$ sudo su
root@ip-000-000-000-000:/#

컴포저 설치는 간단하다.

설치 후 마지막에 버전을 확인하려고 composer -v 를 입력했지만 관리자 계정으로는 컴포저를 실행할 때 경고메세지를 띄웠다.
이번에는 컴포저로 무언가 설치 하려는게 아니니 신경쓰지말고 엔터를 눌러주자. (하단 12번째 줄 참고)

root@ip-000-000-000-000:/# curl -sS https://getcomposer.org/installer | php
All settings correct for using Composer
Downloading...

Composer (version 2.1.8) successfully installed to: /root/composer.phar
Use it: php composer.phar

root@ip-000-000-000-000:/# mv composer.phar /usr/local/bin/composer
root@ip-000-000-000-000:/# chmod +x /usr/local/bin/composer
root@ip-000-000-000-000:/# composer -v
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]?
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version 2.1.8 2021-09-15 13:55:14

Usage:
  command [options] [arguments]

Options:
  -h, --help                     Display this help message
  -q, --quiet                    Do not output any message
  -V, --version                  Display this application version
      --ansi                     Force ANSI output
      --no-ansi                  Disable ANSI output
  -n, --no-interaction           Do not ask any interactive question
      --profile                  Display timing and memory usage information
      --no-plugins               Whether to disable plugins.
  -d, --working-dir=WORKING-DIR  If specified, use the given directory as working directory.
      --no-cache                 Prevent use of the cache
  -v|vv|vvv, --verbose           Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  about                Shows a short information about Composer.
  archive              Creates an archive of this composer package.
  browse               Opens the package's repository URL or homepage in your browser.
  cc                   Clears composer's internal package cache.
  check-platform-reqs  Check that platform requirements are satisfied.
  clear-cache          Clears composer's internal package cache.
  clearcache           Clears composer's internal package cache.
  config               Sets config options.
  create-project       Creates new project from a package into given directory.
  depends              Shows which packages cause the given package to be installed.
  diagnose             Diagnoses the system to identify common errors.
  dump-autoload        Dumps the autoloader.
  dumpautoload         Dumps the autoloader.
  exec                 Executes a vendored binary/script.
  fund                 Discover how to help fund the maintenance of your dependencies.
  global               Allows running commands in the global composer dir ($COMPOSER_HOME).
  help                 Displays help for a command
  home                 Opens the package's repository URL or homepage in your browser.
  i                    Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.
  info                 Shows information about packages.
  init                 Creates a basic composer.json file in current directory.
  install              Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.
  licenses             Shows information about licenses of dependencies.
  list                 Lists commands
  outdated             Shows a list of installed packages that have updates available, including their latest version.
  prohibits            Shows which packages prevent the given package from being installed.
  reinstall            Uninstalls and reinstalls the given package names
  remove               Removes a package from the require or require-dev.
  require              Adds required packages to your composer.json and installs them.
  run                  Runs the scripts defined in composer.json.
  run-script           Runs the scripts defined in composer.json.
  search               Searches for packages.
  self-update          Updates composer.phar to the latest version.
  selfupdate           Updates composer.phar to the latest version.
  show                 Shows information about packages.
  status               Shows a list of locally modified packages.
  suggests             Shows package suggestions.
  u                    Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
  update               Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
  upgrade              Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
  validate             Validates a composer.json and composer.lock.
  why                  Shows which packages cause the given package to be installed.
  why-not              Shows which packages prevent the given package from being installed.

작성일 기준으로 2.1.8 버전의 컴포저가 설치됐다.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함