Composer실행시 에러 – your php version does not satisfy that requirement 해결 방법

에러내용


 

composer install을 실행할 때 다음과 유사한 오류 메시지가 나타날 수 있습니다.
이 해결 방법에 대해 공유합니다.

Composer could not detect the root package (laravel/laravel) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - bfinlay/laravel-excel-seeder[v3.3.0, ..., v3.4.0] require phpoffice/phpspreadsheet ~1.7 -> satisfiable by phpoffice/phpspreadsheet[1.7.0, ..., 1.29.0].
    - phpoffice/phpspreadsheet[1.7.0, ..., 1.8.2] require php ^5.6|^7.0 -> your php version (8.2.7) does not satisfy that requirement.
    - phpoffice/phpspreadsheet[1.9.0, ..., 1.12.0] require php ^7.1 -> your php version (8.2.7) does not satisfy that requirement.
    - phpoffice/phpspreadsheet[1.13.0, ..., 1.14.1] require php ^7.2 -> your php version (8.2.7) does not satisfy that requirement.
    - phpoffice/phpspreadsheet[1.15.0, ..., 1.29.0] require ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.
    - Root composer.json requires bfinlay/laravel-excel-seeder ^3.3 -> satisfiable by bfinlay/laravel-excel-seeder[v3.3.0, ..., v3.4.0].

To enable extensions, verify that they are enabled in your .ini files:
    - /usr/local/etc/php/php.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-bcmath.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-intl.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-zip.ini
    - /usr/local/etc/php/conf.d/xdebug.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-gd` to temporarily ignore these required extensions.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

위의 경우 phpspec/prophecy 라는 패키지가 필요로 하는 PHP 버전과 composer 명령을 실행하는 환경의 버전이 맞지 않기 때문입니다.

 

 

해결방법


 

composer install --ignore-platform-reqs


 

이렇게하면 composer.json의 내용에 따라 지정된 PHP 버전에서 각 패키지가 업데이트됩니다.

 

 

댓글 달기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

위로 스크롤