宝塔Linux面板安装Swoole5扩展错误

在安装Swoole时出现 libbrotlienc 依赖缺失的问题,提示一下错误:

configure: error: Package requirements (libbrotlienc) were not met:

No package 'libbrotlienc' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables BROTLIENC_CFLAGS
and BROTLIENC_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
make: *** No targets specified and no makefile found. Stop.
error

分步解决方案‌:

1. 安装系统依赖

根据你的Linux发行版执行以下命令:

Debian/Ubuntu 系统

# 安装开发库
sudo apt update
sudo apt install -y libbrotli-dev pkg-config

# 安装编译工具链
sudo apt install -y build-essential autoconf automake

CentOS/RHEL 系统

# 安装开发库
sudo yum install -y brotli-devel pkgconfig

# 安装编译工具链
sudo yum groupinstall -y "Development Tools"

2. 验证依赖是否存在

# 检查头文件是否存在(Ubuntu)
ls /usr/include/brotli/encode.h

# 检查库文件是否存在(Ubuntu)
ls /usr/lib/x86_64-linux-gnu/libbrotlienc.so

# CentOS路径可能为
ls /usr/lib64/libbrotlienc.so

3. 手动指定依赖路径(如果自动检测失败)

如果确认已安装但依然报错,临时设置环境变量:

export BROTLIENC_CFLAGS="-I/usr/include/brotli"
export BROTLIENC_LIBS="-lbrotlienc"

然后重新运行Swoole的编译流程

 

 

 

 

主题
喜欢就支持以下吧
  • 本文由 倾尘SEO 发表于 8 小时前
  • 转载请务必保留本文链接:https://www.qcwlseo.com/bt-linux-swoole5-error.html
 评论   0   访客   0
  • 波浪
  • 波浪
  • 波浪
  • 波浪