简体   繁体   English

pcre2.h: 没有那个文件或目录

[英]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.

相关问题 错误构建:致命错误:pcre.h:没有这样的文件或目录 - Error building : fatal error: pcre.h: No such file or directory 在OSX El Capitan上安装imagick for PHP:随附的pcre.h文件存在问题 - Installing imagick for PHP on OSX El Capitan: issue with included pcre.h file 错误:oci.h:没有那个文件或目录 - error: oci.h: No such file or directory 错误:php.h没有这样的文件或目录 - error: php.h no such file or directory php PCRE regex仅获取以.txt结尾的文件名 - php PCRE regex to get only the file name that terminates in .txt 致命错误:ext/standard/php_smart_str.h:安装 yaml 1.3.2 时没有这样的文件或目录 - fatal error: ext/standard/php_smart_str.h: No such file or directory when install yaml 1.3.2 使用 PCRE 正则表达式解析多行 ini 类文件 - Parsing multiline ini like file using PCRE regex PCRE:^ | $和\ A | \ Z? - PCRE: ^|$ and \A|\Z? 在ubuntu 12.04上安装MongoDB php扩展名:致命错误:Zend / zend_string.h:没有此类文件或目录 - MongoDB php extension install on ubuntu 12.04: fatal error: Zend/zend_string.h: No such file or directory 安装 php oauth package 时:找不到 pcre.h,尝试安装 libpcre 开发/头文件 package - When installing php oauth package: Couldn't find pcre.h, try installing the libpcre development/headers package
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM