cannot run C compiled programs...?

robj

Verified User
Joined
Aug 4, 2007
Messages
56
Here's another issue to add to the long string of issues I've been having with DA.

I'm trying to install PDO extension and following 2 different threads for support:
http://www.directadmin.com/forum/showthread.php?t=24448
http://www.directadmin.com/forum/showthread.php?t=23319

The first error I received was
Code:
/usr/local/bin/phpize: /tmp/pear/cache/PDO-1.0.3/build/shtool: /bin/sh: bad interpreter: Permission denied
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF
environment variable is set correctly and then rerun this script.

ERROR: `phpize' failed

I was able to fix this by following step 1 in the first link, but now I get this (log):
Code:
downloading PDO-1.0.3.tgz ...
Starting to download PDO-1.0.3.tgz (52,613 bytes)
.............done: 52,613 bytes
12 source files, building
running: phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
building in /var/tmp/pear-build-admin/PDO-1.0.3
running: /root/tmp/pear/cache/PDO-1.0.3/configure
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
ERROR: `/root/tmp/pear/cache/PDO-1.0.3/configure' failed

Can't find a reason why this is happening. Can anyone help with this? I'm quickly becoming more and more comfortable with shell (as I have yet to break anything), but I still consider myself a novice user.

Thanks
robj
 
Are you doing this as user root or other users?

Did you install directadmin by yourself previously or the directadmin was installed by other person?

If directadmin is installed by another person, do you know if the person who install directadmin for you had removed some development tools from your server after directadmin installation?
 
1) I've tried doing this as the root user in 2 different ways:
a. login as admin user and su to root
b. My host provides a web panel to administer ssh commands, file management, all user, etc.

I get the same errors for both.

2) DirectAdmin creators themselves installed it for me (and there was a number of early issues that needed to be resolved). Unless the DA administrators removed these tools, I'm the only person that has shell access and direct access to my server (via panel). I haven't removed any feature, because I have no idea how to.

robj

[EDIT] If I login without su to root I get a permissions error.
 
Last edited:
I don't want to contact support.

Does anyone have any suggestions?

rob
 
I am not programmer.
But one thing you may try to see is whether gcc works on your system:

create a file called "hello.c" which contains:

main()
{

printf("hello world\n");
}


then try to compile the program:

gcc hello.c

you should see a file a.out if your gcc can compile...


This is one basic thing you may try to check.
No more suggestion other than this since I am not good at this..
 
Hello,

First, this error:
Code:
/bin/sh: bad interpreter: Permission denied
would say that you may want to check your /bin/sh file. Make sure it's present and chmod to 755. If it's a symbolic link, as many are, then make sure wherever it points to exists and is executable. Basically, you should be able to load up the /bin/sh shell by running it manually. (type: /bin/sh)

Regarding the missing autoconf, install it:
http://help.directadmin.com/item.php?id=162

Regarding the error
Code:
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
what does your config.log say? It will tell you why the configure has decided that the compiler isn't working. Once you spot the error in your config.log (start at the bottom and go up) then use your best friend mr google to seek out the cause and solution.

John
 
Everything checks out fine with the /bin/sh file. Permissions are set correctly, and the bash file is present, also with 755 permissions.

I followed the steps to install the missing autoconf file. Although, I'm not completely sure sure what autoconf does, the installation went smooth.

I did not spot the error. I've scoured 4 different config.logs, the only ones I found on my server, and none of them (as I see it) have given me a reason why the compiler would fail.
Really what it comes down to is that I don't know what I'm looking for nor will I know how to spot the error that relates to what I'm trying to install. There are a number of "error"'s thoughout the log. What relates to what is the connection I'm not understanding.

Any ideas?

robj
 
Sorry for the necrobump but since this was the 1st result I got and the 2nd result actually solved it for me, here is the link I followed

https://help.poralix.com/articles/build-process-fails-cannot-run-c-compiled-programs

Either
yum reinstall gcc gcc-c++ make
will fix it and if not the following will.

yum reinstall wget gcc gcc-c++ flex bison make bind bind-libs bind-utils openssl openssl-devel perl quota libaio \
libcom_err-devel libcurl-devel gd zlib-devel zip unzip libcap-devel cronie bzip2 cyrus-sasl-devel perl-ExtUtils-Embed \
autoconf automake libtool which patch mailx bzip2-devel lsof glibc-headers kernel-devel expat-devel db4-devel
 
Back
Top