2011-12-22 18 views
7

Ho seguito questo tutorial http://stevejenkins.com/blog/2011/08/how-to-install-apc-alternative-php-cache-on-centos-5-6/ per installare apc sul mio centos vps hosting ma ricevo alcuni messaggi di errore sull'ultimo passaggio. Qui è il log completo dal terminale:Errore nell'installazione di apc per php su linux/centos

/bin/sh /usr/local/src/APC-3.1.9/libtool --mode=compile cc -I. -I/usr/local/src/APC-3.1.9 -DPHP_ATOM_INC -I/usr/local/src/APC-3.1.9/include -I/usr/local/src/APC-3.1.9/main -I/usr/local/src/APC-3.1.9 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/APC-3.1.9/apc.c -o apc.lo 
mkdir .libs 
cc -I. -I/usr/local/src/APC-3.1.9 -DPHP_ATOM_INC -I/usr/local/src/APC-3.1.9/include -I/usr/local/src/APC-3.1.9/main -I/usr/local/src/APC-3.1.9 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/APC-3.1.9/apc.c -fPIC -DPIC -o .libs/apc.o 
In file included from /usr/local/src/APC-3.1.9/apc.c:44: 
/usr/include/php/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory 
In file included from /usr/local/src/APC-3.1.9/apc.c:44: 
/usr/include/php/ext/pcre/php_pcre.h:37: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token 
/usr/include/php/ext/pcre/php_pcre.h:38: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token 
/usr/include/php/ext/pcre/php_pcre.h:44: error: expected specifier-qualifier-list before 'pcre' 
/usr/local/src/APC-3.1.9/apc.c:393: error: expected specifier-qualifier-list before 'pcre' 
/usr/local/src/APC-3.1.9/apc.c: In function 'apc_regex_compile_array': 
/usr/local/src/APC-3.1.9/apc.c:454: error: 'apc_regex' has no member named 'preg' 
/usr/local/src/APC-3.1.9/apc.c:454: error: 'apc_regex' has no member named 'preg' 
/usr/local/src/APC-3.1.9/apc.c:455: error: 'apc_regex' has no member named 'nreg' 
/usr/local/src/APC-3.1.9/apc.c:455: error: 'apc_regex' has no member named 'nreg' 
/usr/local/src/APC-3.1.9/apc.c: In function 'apc_regex_match_array': 
/usr/local/src/APC-3.1.9/apc.c:487: error: 'apc_regex' has no member named 'preg' 
/usr/local/src/APC-3.1.9/apc.c:487: error: 'apc_regex' has no member named 'preg' 
/usr/local/src/APC-3.1.9/apc.c:488: error: 'apc_regex' has no member named 'nreg' 
/usr/local/src/APC-3.1.9/apc.c:488: error: 'apc_regex' has no member named 'nreg' 
make: *** [apc.lo] Error 1 
[[email protected] APC-3.1.9]# make install 
/bin/sh /usr/local/src/APC-3.1.9/libtool --mode=compile cc -I. -I/usr/local/src/APC-3.1.9 -DPHP_ATOM_INC -I/usr/local/src/APC-3.1.9/include -I/usr/local/src/APC-3.1.9/main -I/usr/local/src/APC-3.1.9 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/APC-3.1.9/apc.c -o apc.lo 
cc -I. -I/usr/local/src/APC-3.1.9 -DPHP_ATOM_INC -I/usr/local/src/APC-3.1.9/include -I/usr/local/src/APC-3.1.9/main -I/usr/local/src/APC-3.1.9 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/src/APC-3.1.9/apc.c -fPIC -DPIC -o .libs/apc.o 
In file included from /usr/local/src/APC-3.1.9/apc.c:44: 
/usr/include/php/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory 
In file included from /usr/local/src/APC-3.1.9/apc.c:44: 
/usr/include/php/ext/pcre/php_pcre.h:37: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token 
/usr/include/php/ext/pcre/php_pcre.h:38: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token 
/usr/include/php/ext/pcre/php_pcre.h:44: error: expected specifier-qualifier-list before 'pcre' 
/usr/local/src/APC-3.1.9/apc.c:393: error: expected specifier-qualifier-list before 'pcre' 
/usr/local/src/APC-3.1.9/apc.c: In function 'apc_regex_compile_array': 
/usr/local/src/APC-3.1.9/apc.c:454: error: 'apc_regex' has no member named 'preg' 
/usr/local/src/APC-3.1.9/apc.c:454: error: 'apc_regex' has no member named 'preg' 
/usr/local/src/APC-3.1.9/apc.c:455: error: 'apc_regex' has no member named 'nreg' 
/usr/local/src/APC-3.1.9/apc.c:455: error: 'apc_regex' has no member named 'nreg' 
/usr/local/src/APC-3.1.9/apc.c: In function 'apc_regex_match_array': 
/usr/local/src/APC-3.1.9/apc.c:487: error: 'apc_regex' has no member named 'preg' 
/usr/local/src/APC-3.1.9/apc.c:487: error: 'apc_regex' has no member named 'preg' 
/usr/local/src/APC-3.1.9/apc.c:488: error: 'apc_regex' has no member named 'nreg' 
/usr/local/src/APC-3.1.9/apc.c:488: error: 'apc_regex' has no member named 'nreg' 

Tutte le idee?

+0

come hai risolto questo problema, puoi condividere? – Hunt

risposta

13

Ho avuto lo stesso problema, e ho trovato questo per lavorare su CentOS 6.2:

sudo yum install php-pear 
sudo yum install php-devel 
sudo yum install httpd-devel 
sudo yum install gcc 
sudo yum install pcre-devel 
sudo pecl install apc-beta 

postale completo qui: http://www.accella.net/installing-apc-on-centos-5/

19

USO:

apt-get install libpcre3-dev 

yum install pcre-devel 
+0

+1 ha funzionato per me –

+0

+1, ha funzionato anche per me (CentOS 6.5) – xmak

+0

+1, funziona per me centos –

0

Sto usando repository remi . (CentOS Release 6.5, PHP 5.4) Si possono elencare i pacchetti disponibili dal seguente comando

yum --enablerepo=remi list php54* 
yum --enablerepo=remi list php54* | grep apc 

mi sono seguente pacchetto apc

php54-php-pecl-apcu.x86_64  4.0.7-1.el6.remi   @remi 

Ora è possibile utilizzare seguente comando per installare APC

yum install php54-php-pecl-apcu --enablerepo=remi