본문 바로가기

카테고리 없음

composer 설치 오류 php 버전 확인

  Problem 1

    - Root composer.json requires php ^7.2.5 but your php version (8.3.10) does not satisfy that requirement.

  Problem 2

    - dragonmantank/cron-expression is locked to version 3.0.1 and an update of this package was not requested.

    - dragonmantank/cron-expression 3.0.1 requires php ^7.1 -> your php version (8.3.10) does not satisfy that requirement.

  Problem 3

    - guzzlehttp/guzzle is locked to version 7.1.0 and an update of this package was not requested.

    - guzzlehttp/guzzle 7.1.0 requires php ^7.2.5 -> your php version (8.3.10) does not satisfy that requirement.

  Problem 4

    - laravel/framework is locked to version v8.6.0 and an update of this package was not requested.

    - laravel/framework v8.6.0 requires php ^7.3 -> your php version (8.3.10) does not satisfy that requirement.

  Problem 5

    - laravel/tinker is locked to version v2.4.2 and an update of this package was not requested.

    - laravel/tinker v2.4.2 requires php ^7.2 -> your php version (8.3.10) does not satisfy that requirement.

  Problem 6

    - laravel/ui is locked to version v3.0.0 and an update of this package was not requested.

    - laravel/ui v3.0.0 requires php ^7.3 -> your php version (8.3.10) does not satisfy that requirement.

  Problem 7

    - lcobucci/jwt is locked to version 3.3.3 and an update of this package was not requested.

    - lcobucci/jwt 3.3.3 requires php ^5.6 || ^7.0 -> your php version (8.3.10) does not satisfy that requirement.

  Problem 8

    - league/glide is locked to version 1.6.0 and an update of this package was not requested.

    - league/glide 1.6.0 requires php ^7.2 -> your php version (8.3.10) does not satisfy that requirement.

  Problem 9

    - opis/closure is locked to version 3.5.7 and an update of this package was not requested.

    - opis/closure 3.5.7 requires php ^5.4 || ^7.0 -> your php version (8.3.10) does not satisfy that requirement.

  Problem 10

    - paragonie/random_compat is locked to version v9.99.99 and an update of this package was not requested.

    - paragonie/random_compat v9.99.99 requires php ^7 -> your php version (8.3.10) does not satisfy that requirement.

  Problem 11

    - spatie/image is locked to version 1.7.6 and an update of this package was not requested.

    - spatie/image 1.7.6 requires php ^7.0 -> your php version (8.3.10) does not satisfy that requirement.

  Problem 12

    - spatie/image-optimizer is locked to version 1.2.1 and an update of this package was not requested.

    - spatie/image-optimizer 1.2.1 requires php ^7.2 -> your php version (8.3.10) does not satisfy that requirement.

  Problem 13

    - spatie/laravel-medialibrary is locked to version 8.7.3 and an update of this package was not requested.

    - spatie/laravel-medialibrary 8.7.3 requires php ^7.4 -> your php version (8.3.10) does not satisfy that requirement.

  Problem 14

    - spatie/laravel-permission is locked to version 3.17.0 and an update of this package was not requested.

    - spatie/laravel-permission 3.17.0 requires php ^7.2.5 -> your php version (8.3.10) does not satisfy that requirement.

  Problem 15

    - spatie/temporary-directory is locked to version 1.2.4 and an update of this package was not requested.

    - spatie/temporary-directory 1.2.4 requires php ^7.2 -> your php version (8.3.10) does not satisfy that requirement.

  Problem 16

    - tymon/jwt-auth is locked to version 1.0.1 and an update of this package was not requested.

    - tymon/jwt-auth 1.0.1 requires php ^5.5.9|^7.0 -> your php version (8.3.10) does not satisfy that requirement.

  Problem 17

    - facade/flare-client-php is locked to version 1.3.6 and an update of this package was not requested.

    - facade/flare-client-php 1.3.6 requires php ^7.1 -> your php version (8.3.10) does not satisfy that requirement.

  Problem 18

    - facade/ignition is locked to version 2.3.7 and an update of this package was not requested.

    - facade/ignition 2.3.7 requires php ^7.2.5 -> your php version (8.3.10) does not satisfy that requirement.

  Problem 19

    - facade/ignition-contracts is locked to version 1.0.1 and an update of this package was not requested.

    - facade/ignition-contracts 1.0.1 requires php ^7.1 -> your php version (8.3.10) does not satisfy that requirement.

  Problem 20

    - filp/whoops is locked to version 2.7.3 and an update of this package was not requested.

    - filp/whoops 2.7.3 requires php ^5.5.9 || ^7.0 -> your php version (8.3.10) does not satisfy that requirement.

  Problem 21

    - fzaninotto/faker is locked to version v1.9.1 and an update of this package was not requested.

    - fzaninotto/faker v1.9.1 requires php ^5.3.3 || ^7.0 -> your php version (8.3.10) does not satisfy that requirement.

  Problem 22

    - nunomaduro/collision is locked to version v5.0.2 and an update of this package was not requested.

    - nunomaduro/collision v5.0.2 requires php ^7.3 -> your php version (8.3.10) does not satisfy that requirement.

  Problem 23

    - phpspec/prophecy is locked to version 1.12.0 and an update of this package was not requested.

    - phpspec/prophecy 1.12.0 requires php ^7.2 || ~8.0, <8.1 -> your php version (8.3.10) does not satisfy that requirement.

  Problem 24

    - paragonie/random_compat v9.99.99 requires php ^7 -> your php version (8.3.10) does not satisfy that requirement.

    - symfony/polyfill-php70 v1.18.1 requires paragonie/random_compat ~1.0|~2.0|~9.99 -> satisfiable by paragonie/random_compat[v9.99.99].

    - symfony/polyfill-php70 is locked to version v1.18.1 and an update of this package was not requested.

1. PHP 7.x 버전 설치

Homebrew를 사용하여 PHP 7.x 버전을 설치합니다. 예를 들어, PHP 7.4를 설치하려면 다음 명령어를 사용하세요:

brew install php@7.4

2. PHP 버전 전환

PHP 7.4를 설치한 후, 기본 PHP 버전을 7.4로 전환해야 합니다. Homebrew에서는 brew link 명령어를 사용하여 이를 수행할 수 있습니다.

brew unlink php brew link --overwrite --force php@7.4

3. PHP 버전 확인

터미널에서 PHP 버전이 제대로 전환되었는지 확인합니다.

php -v

PHP 버전이 7.4.x로 표시되어야 합니다.

4. Composer 설치 또는 업데이트

이제 Composer를 사용하여 의존성을 설치하거나 업데이트할 수 있습니다. 만약 이미 composer install 명령어를 시도했다면, 다음 명령어로 캐시를 지우고 다시 시도해 보세요.

composer clear-cache composer install

5. PHP 버전 복원 (선택 사항)

작업이 완료된 후 다시 PHP 8.3 버전으로 전환하고 싶다면, 다음 명령어를 사용하세요:

brew unlink php@7.4 brew link --overwrite --force php

이 방법을 따르면 PHP 7.x 버전을 요구하는 패키지들과 호환되며, 프로젝트에서 문제없이 Composer를 사용할 수 있습니다.