安装nginx提示 C compiler cc is not found 错误

CentOS 安装 Nginx,使用./configure 命令时,报checking for C compiler … not found

C compiler cc is not found 错误

./configure --prefix=/usr/local/nginx
checking for OS
+ Linux 3.10.0-1160.76.1.el7.x86_64 x86_64
checking for C compiler ... not found
./configure: error: C compiler cc is not found

经过搜索,是没有安装了gcc,PCRE,zlib,openssl。

解决方法:执行命令 yum -y install gcc yum -y install make zlib-devel gcc-c++ libtool openssl openssl-devel

备注: ./configure --prefix=/usr/local/nginx 这里的 /usr/local/nginx 可以修改为其它路径,特别不是ROOT用户安装时,usr没有权限,可以定义其它目录。