nginx报错:./configure: error: C compiler cc is not found, gcc 是已经安装了的

时间:2023-12-28 11:13:08

源码安装nginx报错,找不到gcc,但是实际上gcc是存在的,如下:

# ./configure
checking for OS
 + Linux -.el7.x86_64 x86_64
checking for C compiler ... not found

./configure: error: C compiler cc is not found

# 

尝试找寻gcc

# whereis gcc
.gz
# 

尝试指定cc

# ./configure --with-cc=/usr/bin/gcc
checking for OS
 + Linux -.el7.x86_64 x86_64
checking for C compiler ... not found

./configure: error: C compiler /usr/bin/gcc is not found

[root@localhost nginx-]# ls -l /usr/bin/gcc
-rwxr-xr-x.  root root  Mar  : /usr/bin/gcc# 

依旧报错

最后卸载gcc重新安装成功,不过,模拟不出这种环境了

# yum remove gcc -y
# yum install gcc -y