";没有找到可接受的C编译器“;安装APC时


"No acceptable C compiler found" when installing APC

我需要做些什么才能让APC正常工作,似乎我没有在正确的位置使用c编译器或类似的东西?此外,一旦安装完成,我如何验证它是否正确运行?

[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]#

您的系统缺少C编译器(或者很可能找不到)。

你可能只需要做:

sudo apt-get install build-essential

适用于Debian、Ubuntu或

sudo yum groupinstall "Development Tools"

适用于Red Hat/CentOS。

顺便说一下,您系统的软件包管理器可能会安装APC。

看起来没有安装gcc。根据您的Linux版本,安装gcc的方式有所不同。我相信,如果你发布你正在使用的版本,我们将能够帮助你。

我通过以下方法解决了这个问题:

#rpm -qa | grep gcc
# yum install gcc glibc glibc-common gd gd-devel -y

在我们的CentOS 6 box上,我使用了yum-install php-pecl-apc-我已经先安装了一些其他的yum,如glib、gcc。但至少您知道,百胜将正确处理依赖关系。实际上并没有看到特别的速度增加,但我认为这就是调整的意义所在。