php8.2 安装swoole扩展 (mac m1)

php8.2 安装swoole扩展 发现报错 此处记录

  1. 使用pecl安装
sudo  pecl install swoole
...
# 发现报错

/opt/homebrew/Cellar/php@8.2/8.2.15/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
  1. 试试源码编译安装呢
    下载源码地址
wget https://github.com/swoole/swoole-src/archive/refs/tags/v5.1.2.tar.gz

# 解压
tar zxvf swoole-src-5.1.2.tar.gz                                                             ✔  1035414:51:06
cd swoole-src-5.1.2 && \
phpize && \
./configure && \
sudo make && sudo make install

# 发现报同样错
/opt/homebrew/Cellar/php@8.2/8.2.15/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

着手解决这个异常

brew install pcre2
ln -s /opt/homebrew/Cellar/pcre2/10.42/include/pcre2.h /opt/homebrew/Cellar/php@8.2/8.2.15/include/php/ext/pcre/pcre2.h

重新执行1

安装成功

参考链接

swoole官方文档

博客

相关推荐

  1. php8.2 安装swoole扩展 (mac m1)

    2024-02-20 05:56:03       39 阅读
  2. centos7 安装php82

    2024-02-20 05:56:03       17 阅读
  3. MacOS安装PHP5.6的Redis扩展

    2024-02-20 05:56:03       45 阅读
  4. windows php8.1 安装imagick识别不到扩展

    2024-02-20 05:56:03       7 阅读
  5. Php swoole和mqtt

    2024-02-20 05:56:03       12 阅读
  6. php.2安装Imagick扩展

    2024-02-20 05:56:03       40 阅读
  7. pear + pecl 安装php扩展

    2024-02-20 05:56:03       10 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-02-20 05:56:03       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-02-20 05:56:03       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-02-20 05:56:03       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-02-20 05:56:03       20 阅读

热门阅读

  1. 【牛客】寒假训练营3 J-智乃的相亲活动 题解

    2024-02-20 05:56:03       33 阅读
  2. 利用ChatGPT提升工作效率

    2024-02-20 05:56:03       33 阅读
  3. 搜索+哈希/平衡树,LeetCode 987. 二叉树的垂序遍历

    2024-02-20 05:56:03       33 阅读
  4. 大数据经责审计

    2024-02-20 05:56:03       34 阅读
  5. the file size exceeds the configured limit Android studio

    2024-02-20 05:56:03       24 阅读
  6. c++ %运算符

    2024-02-20 05:56:03       27 阅读