카페24 웹호스팅 composer(의존성도구) 설치 > 정보공유

본문 바로가기

정보공유

일반글
Server

카페24 웹호스팅 composer(의존성도구) 설치

페이지 정보

게시물QR코드

본문

컴포저는 php 의존성 도구입니다.

오픈소스로 제공하고 있는 라이브러리를 사용할 때 어떤 버전을 사용해야 문제가 없는지 알아서 검사를 해주고 설치를 할 수 있습니다.

php 실행 파일의 경로는 /usr/local/php82/bin/php 입니다.

그래서 path에 /usr/local/php82/bin 디렉토리를 추가합니다.

vi .bash_profile

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/usr/local/php82/bin

export PATH


다음으로 컴포저 설치파일을 다운받습니다.

$ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

PHP Warning:  copy(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in Command line code on line 1

PHP Warning:  copy(https://getcomposer.org/installer): Failed to open stream: no suitable wrapper could be found in Command line code on line 1

$ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" -d allow_url_fopen=On


ssh로 접속해서 콘솔에서 명령을 실행하면 php 설정때문에 정상적으로 실행되지 않습니다.

그래서 pc 웹브라우저에서 https://getcomposer.org/installer

입력해서 파일을 다운받고, 이 파일을 카페24 호스팅 계정에 업로드 합니다.


파일명을 변경하고 php 로 실행합니다.

$ mv installer composer-setup.php

$ php composer-setup.php


Some settings on your machine make Composer unable to work properly.

Make sure that you fix the issues listed below and run this script again:


The allow_url_fopen setting is incorrect.

Add the following to the end of your `php.ini`:

    allow_url_fopen = On


The php.ini used by your command-line PHP is: /usr/local/php82/lib/php.ini

If you can not modify the ini file, you can also run `php -d option=value` to modify ini values on the fly. You can use -d multiple times.


php.ini 설정 때문에 정상적으로 설치가 되지 않습니다.

아래에 보면 php.ini 파일을 수정하지 못할 때 실행하는 방법이 나와 있습니다.


php -d option=value

명령어를 수정해서 다시 실행합니다.

php -d allow_url_fopen=On composer-setup.php

정상적으로 컴포저 설치가 완료되었습니다.

$ php -d allow_url_fopen=On composer-setup.php

All settings correct for using Composer

Downloading...

Composer (version 2.6.6) successfully installed to: /jcrm2321/temp/composer.phar

Use it: php composer.phar


php composer.phar 명령으로 컴포저를 실행하면 됩니다.


댓글목록

등록된 댓글이 없습니다.

  • Addr.부산광역시 동구 중앙대로 319, 9층 L4호(초량동, 부산YMCA빌딩) Email. gnuwiz@naver.com
  • BR. 625-68-00172 TRC. 2019-부산해운대-1186 TEL. 0507-1382-2790
All rights reserved.