pcov 설치 중 fatal error: 'pcre2.h' file not found 에러를 만났을 때

pecl install pcov

pecl을 통해 pcov 설치 중 pcre2는 이미 깔려있는데도 이 에러를 만나실 수 있습니다.

그럴땐 pcre2.h 파일을 php 설치경로 아래 특정 폴더에 복사해 주고, 다시 설치를 시도하면 거짓말처럼 성공하는 것을 보실 수 있습니다.

cp /opt/homebrew/Cellar/pcre2/10.40/include/pcre2.h /opt/homebrew/Cellar/[email protected]/7.4.29/include/php/ext/pcre/pcre2.h

위 pcre2 경로와 php 경로를 여러분의 환경에 맞게 바꿔서 호출하시면 됩니다.

자, 일찍 퇴근하세요.