【问题标题】:"No acceptable C compiler found" when installing APC安装 APC 时“找不到可接受的 C 编译器”
【发布时间】:2012-02-13 23:13:01
【问题描述】:

我需要怎么做才能让 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]#

【问题讨论】:

  • 服务器是什么操作系统?
  • 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/Linux

标签: php installation apc


【解决方案1】:

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

您可能只需要这样做:

sudo apt-get install build-essential

对于 Debian 或 Ubuntu 或

sudo yum groupinstall "Development Tools"

适用于红帽/CentOS。

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

【讨论】:

  • 在 Red Hat Enterprise / CentOS 上,您可能需要启用其他软件存储库。 EPEL 有包 php-pecl-apc 用于包含的(史前)PHP 版本。
  • 我安装了开发工具然后尝试运行 pecl install apc,它给了我 /var/tmp/APC/apc.c:454: error: 'apc_regex' has no member named 'preg' 我怎么办知道它是否在运行?对于 php-pecl-apc 是否只是 sudo yum php-pecl-apc?
  • 您的 PHP 中是否编译了 PRCE 支持?
【解决方案2】:

看起来 gcc 没有安装。根据您的 Linux 版本,安装 gcc 的方式会有所不同。我敢肯定,如果您发布您正在使用的版本,我们将能够为您提供帮助。

【讨论】:

  • 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/Linux
  • 这只是关于内核的信息。您需要了解您正在使用的 Linux 发行版。
【解决方案3】:

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

#rpm -qa | grep gcc

# yum install gcc glibc glibc-common gd gd-devel -y

【讨论】:

    【解决方案4】:

    在我们的 CentOS 6 机器上,我使用了 yum install php-pecl-apc - 我先完成了一些其他的 yum 安装,例如 glib、gcc。但至少你知道 yum 会正确处理依赖关系。 实际上并没有看到特定的速度增加,但我认为这就是调整的用武之地。

    【讨论】:

      猜你喜欢
      • 2016-06-08
      • 2013-11-17
      • 1970-01-01
      • 2011-01-14
      • 2018-12-11
      • 1970-01-01
      • 2018-05-18
      • 2012-09-28
      • 1970-01-01
      相关资源
      最近更新 更多