"No acceptable C compiler found" when installing APC
Asked Answered
F

4

9

What do I need to do to get APC to work correctly, it seems I dont have a c compiler in the correct place or something similar to that? Also once it is install how do I verify that it is running correctly?

[root@ec2-user]# pecl install apc
downloading APC-3.1.9.tgz ...
Starting to download APC-3.1.9.tgz (155,540 bytes)
.................................done: 155,540 bytes
54 source files, building
running: phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
config.m4:180: warning: AC_CACHE_VAL(PHP_APC_GCC_ATOMICS, ...): suspicious cache-id,                     must contain _cv_ to be cached
../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from...
config.m4:180: the top level
config.m4:180: warning: AC_CACHE_VAL(PHP_APC_GCC_ATOMICS, ...): suspicious cache-id,     must contain _cv_ to be cached
../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from...
config.m4:180: the top level
Enable internal debugging in APC [no] : no
Enable per request file info about files used from the APC cache [no] : no
Enable spin locks (EXPERIMENTAL) [no] : no
Enable memory protection (EXPERIMENTAL) [no] : no
Enable pthread mutexes (default) [yes] : yes
Enable pthread read/write locks (EXPERIMENTAL) [no] : no
building in /var/tmp/pear-build-root/APC-3.1.9
running: /var/tmp/APC/configure --enable-apc-debug=no --enable-apc-filehits=no --enable-    apc-spinlocks=no --enable-apc-memprotect=no --enable-apc-pthreadmutex=yes --enable-apc-    pthreadrwlocks=no
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... no
checking for gcc... no
configure: error: in `/var/tmp/pear-build-root/APC-3.1.9':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
ERROR: `/var/tmp/APC/configure --enable-apc-debug=no --enable-apc-filehits=no --enable-apc-    spinlocks=no --enable-apc-memprotect=no --enable-apc-pthreadmutex=yes --enable-apc-    pthreadrwlocks=no' failed
[root@ec2-user]#
Fischer answered 13/2, 2012 at 23:13 Comment(2)
What operating system is the server?Beano
2.6.35.14-97.44.amzn1.x86_64 #1 SMP Mon Oct 24 16:03:08 UTC 2011 x86_64 x86_64 x86_64 GNU/LinuxFischer
I
3

Looks like gcc isn't installed. Depending on your release of Linux, the way to install gcc differs. I'm sure if you post which release you're using, we'll be able to help you.

Ikhnaton answered 13/2, 2012 at 23:20 Comment(2)
2.6.35.14-97.44.amzn1.x86_64 #1 SMP Mon Oct 24 16:03:08 UTC 2011 x86_64 x86_64 x86_64 GNU/LinuxFischer
That's just information about the kernel. You need to look know what distribution of Linux you're using.Ikhnaton
K
18

Your system is missing a C compiler (or less likely, it cannot be found).

Likely you just need to do:

sudo apt-get install build-essential

for Debian or Ubuntu or

sudo yum groupinstall "Development Tools"

for Red Hat / CentOS.

By the way, your system's package manager can likely install APC.

Kezer answered 13/2, 2012 at 23:20 Comment(3)
On Red Hat Enterprise / CentOS, you may need to enable additional software repositories. EPEL has the package php-pecl-apc for the included (prehistoric) PHP version.Cornerwise
i installed development toolsthen tried to run pecl install apc and it gave me /var/tmp/APC/apc.c:454: error: 'apc_regex' has no member named 'preg' how do i know if its running? for the php-pecl-apc is it just sudo yum php-pecl-apc?Fischer
Is PRCE support compiled into your PHP?Kezer
I
3

Looks like gcc isn't installed. Depending on your release of Linux, the way to install gcc differs. I'm sure if you post which release you're using, we'll be able to help you.

Ikhnaton answered 13/2, 2012 at 23:20 Comment(2)
2.6.35.14-97.44.amzn1.x86_64 #1 SMP Mon Oct 24 16:03:08 UTC 2011 x86_64 x86_64 x86_64 GNU/LinuxFischer
That's just information about the kernel. You need to look know what distribution of Linux you're using.Ikhnaton
C
2

I solved this via the following:

#rpm -qa | grep gcc

# yum install gcc glibc glibc-common gd gd-devel -y
Censorious answered 6/7, 2015 at 12:47 Comment(0)
G
1

On our CentOS 6 box I used yum install php-pecl-apc - I'd done some other yum installs first such as glib, gcc. But at least you know yum will handle the dependencies properly. Not actually seen a particular speed increase with it, but I assume this is where tuning comes in.

Gyneco answered 18/10, 2012 at 14:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.