2012-02-13 49 views
8

我需要做些什麼才能使APC正常工作,似乎我沒有在正確的地方或類似的地方使用c編譯器?另外一旦安裝,我如何驗證它是否正確運行?安裝APC時發現「沒有可接受的C編譯器」

[[email protected]]# 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 
[[email protected]]# 
+2

什麼操作系統是服務器? – 2012-02-13 23:15:01

+0

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 – user1179295 2012-02-14 01:05:02

回答

3

看起來像gcc沒有安裝。根據您的Linux發行版,安裝gcc的方式有所不同。我確定,如果您發佈了您使用的版本,我們將能夠爲您提供幫助。

+0

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 – user1179295 2012-02-14 01:05:18

+0

這只是關於內核的信息。您需要了解您正在使用的Linux的分佈情況。 – 2015-02-26 20:24:08

15

您的系統缺少C編譯器(或不太可能,找不到)。

可能你只需要做:

sudo apt-get install build-essential 

爲Debian或Ubuntu或

sudo yum groupinstall "Development Tools" 

紅帽/ CentOS的。

順便說一句,您的系統的包管理器可能會安裝APC。

+0

在Red Hat Enterprise/CentOS上,您可能需要啓用其他軟件存儲庫。 [EPEL](http://fedoraproject.org/wiki/EPEL)爲包含的(史前)PHP版本提供了「php-pecl-apc」包。 – Charles 2012-02-13 23:36:47

+0

我安裝了開發工具,試圖運行pecl install apc,它給了我/var/tmp/APC/apc.c:454:錯誤:'apc_regex'沒有名爲'preg'的成員我怎麼知道它的運行?爲php-pecl-apc它只是sudo yum php-pecl-apc? – user1179295 2012-02-14 00:56:19

+0

PRCE是否支持編譯到您的PHP? – Corbin 2012-02-14 03:20:28

1

在我們的CentOS 6盒子上,我使用了yum install php-pecl-apc - 我先做了一些其他的yum安裝,比如glib,gcc。但至少你知道yum會正確處理依賴關係。 其實並沒有見過它特定的速度增長,但我認爲這就是調進來

1

我通過以下解決了這個:

#rpm -qa | grep gcc 

# yum install gcc glibc glibc-common gd gd-devel -y 
相關問題