Laravel 로 개발한 프로젝트에서 Queue 관리를 위해 laravel horizon 을 적용중이었습니다.

composer require laravel/horizon
CODE


다른 개발자 PC 에서도 변경한 composer.json 을 반영하기 위해 composer install 을 실행했더니 다음과 같은 에러를 만났습니다.

the composer was guilty due to an older version of xampp (windows) but now horizon wants to have something different.

Problem 1
- laravel/horizon v1.0.4 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.
CODE


에러 메시지는 laravel horizon은 PHP 의 pcntl 확장이 필요하지만 이 기능은 Unix의 Process Control 기능이라 Windows 에서는 제공되지 않아서입니다.


임시로 처리할 수 있는 해결책은 다음과 같습니다.


WSL 에서 composer 실행

WSL 은 Ubuntu 리눅스가 제공되므로 pcntl 에러 없이 composer 를 실행할 수 있습니다.


특정 플랫폼용 의존성 무시

composer 실행시 --ignore-platform-reqs 옵션을 추가하면 PHP 버전이나, lib-*, ext-* 와 관련된 의존성을 무시하고 강제로 패키지를 설치하므로 pcntl 이 없어도 다른 의존성을 설치할 수 있습니다.


composer install  --ignore-platform-reqs
CODE


Ref