nginx: /lib64/libcrypt.so.1: version `XCRYPT_2.0' not found
1.报错信息
[root@ba6649b3a783 sbin]# ./nginx --t ./nginx: /lib64/libcrypt.so.1: version `XCRYPT_2.0' not found (required by ./nginx) ./nginx: /lib64/libc.so.6: version `GLIBC_2.27' not found (required by ./nginx) ./nginx: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by ./nginx) ./nginx: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by ./nginx)
2.报错原因说明
- 这些错误表明 Nginx 可执行文件链接到了一个或多个系统库,而这些库的版本与当前系统不兼容。主要的问题在于缺少所需的 GLIBC 版本。
- 解决此问题的方法之一是在构建 Nginx 时静态链接所需的库,以便 Nginx 可以独立于系统中的库版本运行。这样做可以确保 Nginx 在不同的系统上都能正常工作,而不受系统库版本的影响。
- 我们可以使用 configure 脚本的 --with-ld-opt 参数,将 -static 添加到链接选项中,以静态链接所需的库。
3.解决方法
./configure --prefix=/data/service/nginx \ --with-http_stub_status_module \ --with-http_gzip_static_module \ --with-http_ssl_module \ --with-http_mp4_module \ --with-stream \ --with-http_realip_module \ --with-http_v2_module \ --with-http_sub_module \ --with-ld-opt='-static' #增加一条配置
4.其他正常编译
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· winform 绘制太阳,地球,月球 运作规律
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· AI 智能体引爆开源社区「GitHub 热点速览」
· 写一个简单的SQL生成工具
· Manus的开源复刻OpenManus初探