Last week, I was setting up Nginx and while compiling I encountered an error, which I was able to resolve as follows.

I thought to document so others can be benefited from it.

[root@chandan nginx-1.6.3]# ./configure --prefix=/apps/nginx --add-module=./ngx_cache_purge-2.3 --add-module=./headers-more-nginx-module-0.25/
checking for C compiler ... not found
./configure: error: C compiler cc is not found

Solution

This usually happens when you don’t have C/GCC compiler installed on your server. All you got to do is to install gcc to resolve this.

# yum install gcc

If using CentOS 8 then you can use the DNF command.

# dnf install gcc

Once installed, you can verify as below.

# gcc
gcc: fatal error: no input files
compilation terminated.
#

This has helped me and I hope you too. Learn more about Linux administration here.