【Nginx】configure 报错checking for C compiler … not found

本文讲述了在编译安装过程中遇到的./configure错误,重点在于解决C编译器未找到和HTTP重写模块所需的PCRE库问题,通过安装GCC、openssl-devel包并确认系统PCRE库使用情况,确保成功配置并完成make和makeinstall过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

编译安装在执行./configure步骤报错,是因为缺少环境变量

checking for C compiler … not found
./configure: error: C compiler cc is not found

解决办法,安装环境需要

yum install gcc gcc-c++ -y

看到这里稍等,如果没有安装openssl openssl-devel 也会编译失败

报错如下

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre= option.

解决办法

安装openssl openssl-devel

yum install openssl openssl-devel -y 

完成后显示如下内容


Configuration summary
  + using system PCRE library
  + OpenSSL library is not used
  + using system zlib library

  nginx path prefix: "/home/nginx"
  nginx binary file: "/home/nginx/sbin/nginx"
  nginx modules path: "/home/nginx/modules"
  nginx configuration prefix: "/home/nginx/conf"
  nginx configuration file: "/home/nginx/conf/nginx.conf"
  nginx pid file: "/home/nginx/logs/nginx.pid"
  nginx error log file: "/home/nginx/logs/error.log"
  nginx http access log file: "/home/nginx/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"
 

剩下就可以执行make 和make install了

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值