php7.2.17编译opcache失败

问答中心分类: PHPphp7.2.17编译opcache失败
Bwish asked 5 年 ago

之前安装环境是选择未启用opcache,现在想自己编译,结果一直编译失败。

/bin/sh /root/zendopcache-7.0.5/libtool --mode=compile cc -I. -I/root/zendopcache-7.0.5 -DPHP_ATOM_INC -I/root/zendopcache-7.0.5/include -I/root/zendopcache-7.0.5/main -I/root/zendopcache-7.0.5 -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/zendopcache-7.0.5/ZendAccelerator.c -o ZendAccelerator.lo 
mkdir .libs
cc -I. -I/root/zendopcache-7.0.5 -DPHP_ATOM_INC -I/root/zendopcache-7.0.5/include -I/root/zendopcache-7.0.5/main -I/root/zendopcache-7.0.5 -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/zendopcache-7.0.5/ZendAccelerator.c -fPIC -DPIC -o .libs/ZendAccelerator.o
In file included from /root/zendopcache-7.0.5/ZendAccelerator.h:57:0,
from /root/zendopcache-7.0.5/ZendAccelerator.c:27:
/root/zendopcache-7.0.5/zend_accelerator_hash.h:50:2: error: unknown type name ‘zend_uint’
zend_uint key_length;
^
/root/zendopcache-7.0.5/zend_accelerator_hash.h:59:2: error: unknown type name ‘zend_uint’
zend_uint num_entries;
^
/root/zendopcache-7.0.5/zend_accelerator_hash.h:60:2: error: unknown type name ‘zend_uint’
zend_uint max_num_entries;
^
/root/zendopcache-7.0.5/zend_accelerator_hash.h:61:2: error: unknown type name ‘zend_uint’
zend_uint num_direct_entries;
^
/root/zendopcache-7.0.5/zend_accelerator_hash.h:64:56: error: unknown type name ‘zend_uint’
void zend_accel_hash_init(zend_accel_hash *accel_hash, zend_uint hash_size);
^
/root/zendopcache-7.0.5/zend_accelerator_hash.h:70:3: error: unknown type name ‘zend_uint’
zend_uint key_length,
^
/root/zendopcache-7.0.5/zend_accelerator_hash.h:77:3: error: unknown type name ‘zend_uint’
zend_uint key_length);
^
/root/zendopcache-7.0.5/zend_accelerator_hash.h:82:3: error: unknown type name ‘zend_uint’
zend_uint key_length);
^
/root/zendopcache-7.0.5/zend_accelerator_hash.h:87:3: error: unknown type name ‘zend_uint’
zend_uint key_length);
^
/root/zendopcache-7.0.5/ZendAccelerator.c:39:35: fatal error: TSRM/tsrm_virtual_cwd.h: No such file or directory
#include "TSRM/tsrm_virtual_cwd.h"
^
compilation terminated.
make: *** [ZendAccelerator.lo] Error 1

php -v

PHP 7.2.17 (cli) (built: Apr 24 2019 10:47:07) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies


Question Tags:

2 Answers
oneinstack answered 5 年 ago
php7.2源码中包含opcache,参考php-7.2.17/ext/opcache 

Bwish answered 5 年 ago
好的,谢谢已经搞定,谢谢老板。