在linux / centos上安装php的apc时出错

前端之家收集整理的这篇文章主要介绍了在linux / centos上安装php的apc时出错前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我按照本教程 http://stevejenkins.com/blog/2011/08/how-to-install-apc-alternative-php-cache-on-centos-5-6/在我的centos vps主机上安装apc但是我在最后一步得到了一些错误消息.这是终端的完整日志:
/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
[root@lvps178-77-79-75 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: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'

有任何想法吗?

解决方法

我遇到了同样的问题,我发现这可以在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

完整帖子在这里:http://www.accella.net/installing-apc-on-centos-5/

原文链接:https://www.f2er.com/linux/394918.html

猜你在找的Linux相关文章