LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-01-2009, 07:47 AM   #1
the182guy
Member
 
Registered: Jan 2009
Posts: 40

Rep: Reputation: 15
Can't install gcc because I don't have a C compiler !?


Hi all,

I'm using a CentOS dedicated server via SSH. I tired to install a newer version of PHP on it but it failed on the ./configure command because I don't have a compiler.

I figured I need to install gcc, so I downloaded the source and extracted. I tried to run the ./configure command but it failed telling me no acceptable C compiler found in $PATH

I don't understand... I need a C compiler to install the C compiler ?? Here's the output of the configure command for installing gcc

Code:
[root@ds-04648 objdir]# ../gcc-4.4.1/configure --prefix=/opt/gcc4
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: in `/ccinstall/gcc/objdir':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
Any ideas? All I want is to install gcc so I can install a newer version of PHP.

Thanks in advance!
 
Old 09-01-2009, 08:21 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Install gcc using your distro's package management system (which provides pre-built packages, so no compiler is needed). You may have to install other packages too.
 
Old 09-01-2009, 08:43 AM   #3
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668
Quote:
Originally Posted by Nylex View Post
Install gcc using your distro's package management system (which provides pre-built packages, so no compiler is needed). You may have to install other packages too.
CentOS uses yum and rpm.

Run "rpm -q gcc" to verify it isn't already installed. If it isn't then run: "yum install gcc".

If it is installed you may simply have a path issue.

Running "rpm -ql gcc" will show you all the files installed by gcc package including the gcc comand itself. make sure the path to that is in your PATH variable.
 
Old 09-01-2009, 08:48 AM   #4
ongte
Member
 
Registered: Jun 2009
Location: Penang, Malaysia
Distribution: Mageia, CentOS, Ubuntu
Posts: 468

Rep: Reputation: 72
If you plan on compiling software, you'll probably need more than just GCC.
I'd suggest you do:
# yum groupinstall "Development Tools"
 
Old 09-01-2009, 09:35 AM   #5
the182guy
Member
 
Registered: Jan 2009
Posts: 40

Original Poster
Rep: Reputation: 15
Thanks guys I did what you suggested. I now get further but still hitting a wall.

When I run my PHP configure comman I get this error:


checking for QDBM support... no
checking for GDBM support... no
checking for NDBM support... no
configure: error: DBA: Could not find necessary header file(s).


I have installed the gdbm package by using:

yum install gdbm-devel

But the error still remains. Even when I use --without-gdbm in the configure command I still get this error.

Any ideas?
 
Old 09-01-2009, 10:03 AM   #6
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,363

Rep: Reputation: 172Reputation: 172
Usually the easiest way to build packages on any distro is to see how the packagers built the last version of that software and start from there. Grab the source rpm of the last version of PHP and look at the spec file. It will tell you what patches had to be applied and how to configure things.

Edit: You may also want to tell us which version you are trying to build and why you think you need it.

Last edited by lazlow; 09-01-2009 at 10:05 AM.
 
Old 09-02-2009, 03:43 PM   #7
the182guy
Member
 
Registered: Jan 2009
Posts: 40

Original Poster
Rep: Reputation: 15
Thanks for the help all. I fixed it eventually by removing the --with-db4 my PHP 5.3 install is running nicely now
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to install gcc and g++ compiler... Carunkumar SUSE / openSUSE 3 01-03-2011 10:48 PM
how to install c compiler -gcc?? alifaziz Mandriva 3 08-22-2007 02:35 PM
Can't install GCC compiler!??!?! MickBurke Linux - Newbie 3 03-07-2005 02:53 PM
why i can't install gcc or any other C compiler? HoreC Debian 3 11-21-2004 11:51 AM
GCC Compiler Install Alpha-01 Linux - Newbie 6 10-03-2004 09:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration