mac下brew install php后用pecl安装swoole报错找不到`pcre2.h`

mac下brew install php后用pecl安装swoole报错找不到pcre2.h

In file included from /private/tmp/pear/temp/swoole/ext-src/php_swoole.cc:21:
/usr/local/Cellar/php/8.0.0_1/include/php/ext/pcre/php_pcre.h:23:10: fatal error: 'pcre2.h' file not found
#include "pcre2.h"
         ^~~~~~~~~
1 error generated.
make: *** [ext-src/php_swoole.lo] Error 1
ERROR: `make' failed

解决办法:
定义一个软连接到对应位置就可以了,如下:

ln -s /usr/local/Cellar/pcre2/10.37_1/include/pcre2.h /usr/local/Cellar/php/8.0.10/include/php/ext/pcre/pcre2.h

你可能感兴趣的:(PHP,php)