pcre2.h: No such file or directory

Viewed 1477

I try to install openswoole on my mac machine. I have this issue when installing it.

/usr/local/Cellar/php@7.4/7.4.29/include/php/ext/pcre/php_pcre.h:25:10: fatal error: pcre2.h: No such file or directory
 #include "pcre2.h"

I used the command brew install pcre to fix this issue as others recommend, but I always get the same result. I try to open the folder pcre I only see one php_pcre.h file inside it.

2 Answers

try:

sudo ln -s /opt/local/include/pcre.h /usr/include/       "replace your file location here"
sudo pecl install apc 

Here's simplest solution. I have finally solved my problem. I used PHP 8.1.7 - Mac Pro 2022 - Apple Silicon (M1)

My errors: fatal error: 'pcre2.h' file not found

The solution that I used:

1. brew install pcre2

2. ln -s /opt/homebrew/Cellar/pcre2/10.40/include/pcre2.h /opt/homebrew/Cellar/php/8.1.7/include/php/ext/pcre/pcre2.h 

Please check your path again when use `ln -s` 

3. sudo pecl install ... something you want to install :) **openswoole** with you :).

Success Installation:

enter image description here

Hope it help you :) Thanks

Related