Centos下安装apahce的configure: error: APR not found. P
封面图
•
2025-11-29
•
Linux
186
0
0
0
在 CentOS 下安装 Apache 时,如果遇到以下错误: ``` configure: error: APR not found. Please read the documentation. ``` 这表示系统中缺少 **APR(Apache Portable Runtime)** 库及其开发文件。Apache 在编译时需要这些库来正常工作。 --- ### ✅ 解决方法:安装 APR 和相关依赖 你可以使用 `yum` 或 `dnf` 来安装这些依赖项。以下是具体步骤: #### 1. 安装 APR 及其开发包 ```bash sudo yum install apr-devel ``` 或者使用 `dnf`(适用于较新的 CentOS 版本,如 CentOS 8): ```bash sudo dnf install apr-devel ``` #### 2. 安装其他可能需要的依赖(可选) 有时候还需要安装 `pcre-devel`、`expat-devel` 等: ```bash sudo yum install pcre-devel expat-devel ``` --- ### 🔄 如果你从源码编译 Apache 如果你是从源码编译 Apache,确保在运行 `./configure` 之前已经安装了上述依赖。 例如: ```bash ./configure --prefix=/usr/local/apache2 make sudo make install ``` --- ### 🧠 补充说明 - `apr-devel` 包含了编译 Apache 所需的 APR 头文件和库。 - 如果你使用的是 `httpd` 软件包(通过 `yum` 安装),通常不需要手动编译,可以直接用: ```bash sudo yum install httpd ``` 然后启动服务: ```bash sudo systemctl start httpd sudo systemctl enable httpd ``` --- ### ✅ 总结 | 错误信息 | 解决方案 | |----------|----------| | `configure: error: APR not found` | 安装 `apr-devel` 包 | 如果你还有其他错误,请贴出完整的错误信息,我可以帮你进一步分析。
上一篇:
CentOS 7.4 系统安装 git
下一篇:
CentOS 7.0:[1]搭建SVN服务器
标题录入,一次不能超过6条
留言
评论