본문 바로가기
프레임워크/라라벨 (laravel)

laravel 8 설치 오류 - Composer 설치

by 마루의 일상 2021. 11. 26.
728x90
반응형

윈도우 환경에 라라벨 8 설치 하기위해서는 윈도우용 컴포저가 필요하다

링크 https://getcomposer.org/download/ 에 접속후 

 

Composer

Download Composer Latest: v2.1.12 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/in

getcomposer.org

밑 줄 친 부분을 클릭 후 윈도우용 설치파일을 다운로드한후 실행해 준다.

php 실행파일을 선택해준다. 개인적으로 MAMP사용중이다.

 

설치가 완료되면 라라벨을 설치할 폴더에서 커맨드라인명령으로 설치를 해준다.

먼저 컴퍼저로 라라벨 인스톨러를 다운로드한다.

composer global require laravel/installer

laravel new blog

laravel new blog라고 명령를 하면 blog폴더에 라라벨 파일이 생성된다.

간혹 설치하다보면 오류가 나는 경우가 있다.

오류 내용

Creating a "laravel/laravel" project at "./blog"
    Installing laravel/laravel (v8.6.7)
  - Installing laravel/laravel (v8.6.7): Extracting archive
    Created project in D:\test\laravel/blog
> @php -r "file_exists('.env') || copy('.env.example', '.env');"
    Loading composer repositories with package information
    Updating dependencies
    Your requirements could not be resolved to an installable set of packages.

   Problem 1
    - codeigniter4/framework[4.0.0, ..., v4.1.5] require ext-intl * -> it is missing from your system. Install or enable PHP's intl extension.
    - Root composer.json requires codeigniter4/framework ^4 -> satisfiable by codeigniter4/framework[4.0.0, ..., v4.1.5].

To enable extensions, verify that they are enabled in your .ini files:
    - C:\MAMP\bin\php\php7.4.1\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

당황하지 말고 오류내용을 자세히 보면 ext-intl이라는 내용이 나온다.

C:\MAMP\bin\php\php7.4.1\php.ini에 파일에서 설정을 아래 대로 변경하면 된다.

 

5.* 버전
;extension=php_intl.dll --> extension=php_intl.dll


7.* 버전
;extension=intl --> extension=intl

mamp 상에서는 서버 재시작을 하지 않아도 적용된다.

위에 설정대로 변경한후 다시 laravel new blog실행하면 정상적으로 설치된다.

정상적으로 설치 된것을 알 수있다.

그럼 즐거운 코딩 합시다.

728x90
반응형