본문 바로가기

취미, 관심/NAS, Server

[Synology] DSM7.2, php8.2 환경에서 composer 사용하기

시놀로지 나스 카페에서 글을 보던 중 composer 설치에 문제가 있으신 분이 있어 찾아봤는데, 동일한 문제가 발생함을 확인했습니다.

 

# /test$ composer require phpoffice/phpspreadsheet

Cannot use phpoffice/phpspreadsheet's latest version 3.6.0 as it requires ext-fileinfo * which is missing from your platform.
Cannot use phpoffice/phpspreadsheet 3.6.0 as it requires ext-gd * which is missing from your platform.
Cannot use phpoffice/phpspreadsheet 3.6.0 as it requires ext-zip * which is missing from your platform.
Cannot use phpoffice/phpspreadsheet 1.14.1 as it requires php ^7.2 which is not satisfied by your platform.

In PackageDiscoveryTrait.php line 325:

  Package phpoffice/phpspreadsheet has requirements incompatible with your PHP version, PHP extensions and Composer ve
  rsion:
    - phpoffice/phpspreadsheet 3.6.0 requires ext-fileinfo * but it is not present.
    - phpoffice/phpspreadsheet 3.6.0 requires ext-gd * but it is not present.
    - phpoffice/phpspreadsheet 3.6.0 requires ext-zip * but it is not present.


require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--update-no-dev] [-w|--update-with-dependencies] [-W|--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-m|--minimal-changes] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--] [<packages>...]

 

아래 명령으로 해결합니다.

composer require phpoffice/phpspreadsheet --ignore-platform-req=ext-gd --ignore-platform-req=ext-fileinfo --ignore-platform-req=ext-zip