SOLVED: Problem installing php-apc on CentOs4

I am getting this error when I try to install apc on my webserver, I was wondering if any of you had encountered this issue and how you fixed it… Thanks ;)

pecl install apc

problem = checking whether the C compiler works… configure: error: cannot run C

downloading APC-3.0.19.tgz ...


Starting to download APC-3.0.19.tgz (115,735 bytes)


.........................done: 115,735 bytes


47 source files, building


running: phpize


Configuring for:


PHP Api Version:         20041225


Zend Module Api No:      20060613


Zend Extension Api No:   220060519


 1. Use apxs to set compile flags (if using APC with Apache)? : yes





1-1, 'all', 'abort', or Enter to continue:


building in /var/tmp/pear-build-root/APC-3.0.19


running: /var/cache/php-pear/APC-3.0.19/configure --with-apxs


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: `/var/cache/php-pear/APC-3.0.19/configure --with-apxs' failed


I've seen that error message in a completely different context and, IIRC, I added a blank line in order to to break up the concatenation of lines in some "configure driver script". At least that was my workaround, IIRC. I'm not an expert on the GNU Make process, though (I use to work in a Windows environment).



...


...


 CC="gcc -mno-cygwin" CXX="g++ -mno-cygwin" 





./configure 


...


...


Are you sure all required devel packages are installed on your machine? Besides that you could take a look at memcache or xcache.

indeed, all devel packages are installed.

i think i may need to try a new c compiler…

is /var/tmp mounted non-exec?

simfs on /var/tmp type simfs (rw,noexec)

I had the same problem on my host, fixed it with…chmod 755 /usr/bin/gcc

chmod 755 /usr/bin/ld

No, it's not the same problem; it's not gcc permission, it's /tmp permission.

You can try to make it use another directory than /var/tmp for compilation (possibly there are ./configure options), or remount /var/tmp exec.

should be mount -o remount,exec /var/tmp

This is probably meant as a security measure (most probably ineffective though), so you might want to remount it noexec again.

thanks mh, that was it.  :D

karma++ for you