php 5.5.33 安装apc扩展错误之解决办法

因为开发需求,线上需要安装下PHP的APC扩展,我们的PHP版本为5.5.33 当时尝试安装apc扩展版本

为 APC-3.3.13 安装步骤如下:

 tar zvfx apc-3.3.13.tar.gz

 cd apc-3.3.13

 /usr/local/php-5.5.33/bin/phpize

 ./configure --enable-apc --enable-apc-mmap --with-php-config=/usr/local/php-5.5.33/bin/php-config #很顺畅~

#直到make 出现了如下错误

make        

#--------------------------------------------------------------------------------------------

/root/tools/APC-3.1.13/apc_compile.c:47:25: note: in definition of macro ‘CHECK’
#define CHECK(p) { if ((p) == NULL) return NULL; }
^
/root/tools/APC-3.1.13/apc_compile.c:2380:57: error: ‘zend_trait_alias’ has no member named ‘function’
CHECK(dst->function = my_copy_function(NULL, src->function, ctxt TSRMLS_CC));
^
/root/tools/APC-3.1.13/apc_compile.c:47:25: note: in definition of macro ‘CHECK’
#define CHECK(p) { if ((p) == NULL) return NULL; }
^
/root/tools/APC-3.1.13/apc_compile.c: In function ‘apc_copy_trait_precedence’:
/root/tools/APC-3.1.13/apc_compile.c:2416:12: error: ‘zend_trait_precedence’ has no member named ‘function’
if (src->function) {
^
/root/tools/APC-3.1.13/apc_compile.c:2417:18: error: ‘zend_trait_precedence’ has no member named ‘function’
CHECK(dst->function = my_copy_function(NULL, src->function, ctxt TSRMLS_CC));
^
/root/tools/APC-3.1.13/apc_compile.c:47:25: note: in definition of macro ‘CHECK’
#define CHECK(p) { if ((p) == NULL) return NULL; }
^
/root/tools/APC-3.1.13/apc_compile.c:2417:57: error: ‘zend_trait_precedence’ has no member named ‘function’
CHECK(dst->function = my_copy_function(NULL, src->function, ctxt TSRMLS_CC));
^
/root/tools/APC-3.1.13/apc_compile.c:47:25: note: in definition of macro ‘CHECK’
#define CHECK(p) { if ((p) == NULL) return NULL; }
^
make: *** [apc_compile.lo] 错误 1

#--------------------------------------------------------------------------------------------

 

各种google baidu搜索大家回复 多数都是 apc 最新支持到PHP5.4版本。

正当准备和它死磕到底的时候 万能的google大神搜索到了一条如下信息:

Fix build with latest PHP 5.5 

毫不犹豫的下载最新提交的版本进行安装测试,顺利编译通过。

完整编译方式如下:

 tar zvfx apc-6a90406.tar.gz

 cd apc-6a90406

 /usr/local/php-5.5.33/bin/phpize

 ./configure --enable-apc --enable-apc-mmap --with-php-config=/usr/local/php-5.5.33/bin/php-config

 make

 make install

cd ..

软件包下载地址如下 可根据需求自行选择下载:

http://git.php.net/?p=pecl/caching/apc.git;a=shortlog

 

posted @ 2016-04-07 20:36  study-notes  阅读(1103)  评论(0编辑  收藏  举报