本文主要是介绍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
这篇关于mac下brew install php后用pecl安装swoole报错找不到`pcre2.h`的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!