본문 바로가기

프로그래밍

[PHP]composer 예전 버전 설치하는 방법(윈도우)

반응형

 

급한사람은 밑에부터

출저

https://getcomposer.org/doc/00-intro.md#installation-windows

 

Introduction - Composer

Dependency management System Requirements Installation - Linux / Unix / macOS Downloading the Composer Executable Locally Globally Installation - Windows Using the Installer Manual Installation Docker Image Using Composer Introduction# Composer is a tool f

getcomposer.org

이걸 찾아보는 불쌍한 영혼들은 알다시피

window에서 compose는 exe파일(Composer-Setup.exe)로 설치가 가능하다.

하지만...

뭐래니 얘..

 

Some settings on your machine may cause stability issues with Composer.
If you encounter issues, try to change the following:

The Windows OneDrive folder is not supported on PHP versions below 7.2.23 and 7.3.10.
Upgrade your PHP (7.2.8) to use this location with Composer.

 

근데 찾아보니까 composer를 exe로 설치하는것은 최신버전밖에 안된댄다..

 

'ㅅ'...

그러면 수동 설치를 해야하는데 수동 설치를 하는 방법은 아래와같다.

https://getcomposer.org/download/

 

Composer

Download Composer Latest: v2.4.4 To quickly install Composer in the current directory, run the following script in your terminal. To automate the installation, use the guide on installing Composer programmatically. php -r "copy('https://getcomposer.org/ins

getcomposer.org

이 페이지로 들어가 밑으로 쭉 내리면 아래 이미지와 같은 리스트가 보인다

 

나는 php 5.6에 호완되는 composer를 다운받는 다는 가정을 하겠다

그래서

Latest Stable (sha256 / sha256sum / asc) for PHP 7.2+ users

이것을 다운받아서 시스템 환경변수에 설정된 php path 폴더에 넣을것이다.

혹시 모르는 분들을 위해 시작에서 시스템 환경변수 편집 검색해서 들어가면된다
바로뜨는 창에 환경변수 클릭
path를 더블클릭 or 편집
나는 c드라이브에 php가 있다
해당디렉토리에 다운로드 받은 composer.phar옮기기

그리고 powershell을 켜서 해당 디렉토리로 이동한후 다음과 같은 명령어를 입력한다

Set-Content composer.bat '@php "%~dp0composer.phar" %*'

그러면 composer.bat파일이 생성된다

 

자 그럼 이제 제대로 설치됬는지 아래 명령어로 확인해보자

composer -V

 

위의 방법을 해도 안되시는 분들! 아래 클릭

더보기

이런경우에는 path설정이 잘못되있는 경우가 대부분이다.

자세히 보면 C:\composer가 위에 있다.

C:\composer를 가보니

버전은 몇인지 모르겠지만 내가 exe로 설치해놓은 흔적이있다.

이러한 경우에는 C:\composer를 내가 쓰고싶어하는 composer 디렉토리 위치보다 우선순위를 낮춘다.

방금 설치한 위치인 C:\php72를 c:\composer보다 위에둔다

그리고서 환경설정 저장하고 cmd나 powershell을 다시키면 해결

(이래도 안되면 apache 재시작이라던가...)

 

 

그리고 이걸 찾아야하는 회사라면 빠른탈출을하길 바란다.

반응형