[英]pcre2.h: No such file or directory
I try to install openswoole
on my mac machine.我尝试在我的 mac 机器上安装
openswoole
。 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.我按照其他人的建议使用命令
brew install pcre
来解决这个问题,但我总是得到相同的结果。 I try to open the folder pcre
I only see one php_pcre.h
file inside it.我尝试打开文件夹
pcre
我只看到里面有一个php_pcre.h
文件。
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)
我使用 PHP 8.1.7 - Mac Pro 2022 - Apple Silicon (M1)
My errors: fatal error: 'pcre2.h' file not found我的错误:致命错误:找不到“pcre2.h”文件
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:安装成功:
Hope it help you :) Thanks希望它对你有帮助:) 谢谢
For M1 MacBooks, this is how I fixed that error when installing rdkafka.对于 M1 MacBooks,这就是我在安装 rdkafka 时修复该错误的方法。
pecl install rdkafka
Error错误
/Applications/MAMP/bin/php/php8.0.8/include/php/ext/pcre/php_pcre.h:23:10: fatal error: 'pcre2.h' file not found
#include "pcre2.h"
^~~~~~~~~
Solution解决方案
ln -s /opt/homebrew/Cellar/pcre2/10.40/include/pcre2.h /Applications/MAMP/bin/php/php8.0.8/include/php/ext/pcre/pcre2.h
See the new link查看新链接
➜ cd /Applications/MAMP/bin/php/php8.0.8/include/php/ext/pcre
➜ ls -l
total 8
lrwxr-xr-x 1 ddhondup admin 48 Oct 6 15:29 pcre2.h -> /opt/homebrew/Cellar/pcre2/10.40/include/pcre2.h
-rw-rw-r-- 1 ddhondup admin 3970 Oct 1 2021 php_pcre.h
After adding the link, it worked.添加链接后,它起作用了。
Build process completed successfully
Installing '/Applications/MAMP/bin/php/php8.0.8/lib/php/extensions/no-debug-non-zts-20200930/rdkafka.so'
install ok: channel://pecl.php.net/rdkafka-6.0.3
configuration option "php_ini" is not set to php.ini location
You should add "extension=rdkafka.so" to php.ini
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.