C gcc compiler not found when installing passenger and nginx

I am trying to install Passenger and Nginx on my VPS.

I followed these instructions and replaced all links from all sources to the current version.

But when I launched the Phusion Passenger installer for Nginx, something with the gcc compiler went wrong:

Compiling and installing Nginx... # sh ./configure --prefix='/opt/nginx' --with-http_ssl_module --with-http_gzip_static_module --with-cc-opt='-Wno-error' --add-module='/usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.17/ext/nginx' checking for OS + Linux 2.6.32-220.el6.x86_64 x86_64 checking for C compiler ... not found ./configure: error: C compiler gcc is not found 

What should I do?

OBS: My VPS works with CentOS 6.2 x64

+4
source share
6 answers

If you have gcc installed, the problem is with installing / tmp as noexec. The error doesn’t quite help, but if you remount / tmp as exec, you can set the passenger correctly.

 mount -o remount,rw,exec,nosuid /tmp 
+9
source

Have the same problem, and the following teams solve it; (on ubuntu server)

 sudo apt-get install linux-kernel-headers sudo apt-get install build-essential 
+2
source

same problem here, and I found out that I cannot run the command as root should use

  sudo 

and he worked like a charm

+2
source

Make sure you sudo, if applicable.

Example:

 sudo ./configure ... 
+1
source

Received the same error. Gcc has just been installed and it starts working:

yum install gcc

+1
source

One quick hack (I fought a lot with it and finally installed it in advance) should install the pre-built Nginx package, and not compile it from the source.

For RHEL / CentOS, create a file called /etc/yum.repos.d/nginx.repo with the following contents:

 [nginx] name=nginx repo baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/ gpgcheck=0 enabled=1 

In the above baseurl replace "OS" with "centos" and "OSRELEASE" with "6".

Finally run yum install nginx

Link https://nginx.org/en/linux_packages.html#stable

0
source

Source: https://habr.com/ru/post/1438276/


All Articles