× 警告!旧版文档已经暂停维护,请查看新版文档。点击前往新版文档

pcre.h: No such file or directory

编译swoole扩展出现

fatal error: pcre.h: No such file or directory

原因是缺少pcre,需要安装libpcre

ubuntu/debian:

sudo apt-get install libpcre3 libpcre3-dev

centos/redhat:

sudo yum install pcre-devel

其他Linux:

PCRE官方网站下载源码包,编译安装pcre库。

安装好PCRE库后需要重新编译安装swoole,然后使用php --ri swoole查看swoole扩展相关信息中是否有pcre => enabled


  • 李均洽

    装pcre2不行,要装pcre

  • 玉帝老大爷

    Ubuntu 的系统环境,apt-get install libpcre3 libpcre3-dev 执行了这个命令。可是那个问题还是没有解决啊!!!!

  • Chris

    yum install pcre-devel 安装了 依然失败

  • ccc

    yum install pcre-devel 安装了 依然失败 求解决方案 gcc版本 4.8 /usr/include/php/Zend/zend_operators.h: In function 'void fast_long_increment_function(zval*)': /usr/include/php/Zend/zend_operators.h:446:68: error: '__builtin_saddl_overflow' was not declared in this scope if (UNEXPECTED(__builtin_saddl_overflow(Z_LVAL_P(op1), 1, &lresult))) { ^ /usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED' # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0) ^ /usr/include/php/Zend/zend_operators.h: In function 'void fast_long_decrement_function(zval*)': /usr/include/php/Zend/zend_operators.h:500:68: error: '__builtin_ssubl_overflow' was not declared in this scope if (UNEXPECTED(__builtin_ssubl_overflow(Z_LVAL_P(op1), 1, &lresult))) { ^ /usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED' # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0) ^ /usr/include/php/Zend/zend_operators.h: In function 'void fast_long_add_function(zval*, zval*, zval*)': /usr/include/php/Zend/zend_operators.h:554:80: error: '__builtin_saddl_overflow' was not declared in this scope if (UNEXPECTED(__builtin_saddl_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &lresult))) { ^ /usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED' # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0) ^ /usr/include/php/Zend/zend_operators.h: In function 'void fast_long_sub_function(zval*, zval*, zval*)': /usr/include/php/Zend/zend_operators.h:657:80: error: '__builtin_ssubl_overflow' was not declared in this scope if (UNEXPECTED(__builtin_ssubl_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &lresult))) { ^ /usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED' # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)

  • ccc

    [root@ip-172-31-22-181 swoole]# make /bin/sh /root/swoole/libtool --mode=compile g++ -I. -I/root/swoole -DPHP_ATOM_INC -I/root/swoole/include -I/root/swoole/main -I/root/swoole -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 -I/root/swoole -I/root/swoole/include -DHAVE_CONFIG_H -g -O2 -c /root/swoole/swoole_coroutine.cc -o swoole_coroutine.lo libtool: compile: g++ -I. -I/root/swoole -DPHP_ATOM_INC -I/root/swoole/include -I/root/swoole/main -I/root/swoole -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 -I/root/swoole -I/root/swoole/include -DHAVE_CONFIG_H -g -O2 -c /root/swoole/swoole_coroutine.cc -fPIC -DPIC -o .libs/swoole_coroutine.o In file included from /usr/include/php/Zend/zend_types.h:27:0, from /usr/include/php/Zend/zend.h:29, from /usr/include/php/main/php.h:35, from /root/swoole/php_swoole.h:20, from /root/swoole/swoole_coroutine.cc:18: /usr/include/php/Zend/zend_operators.h: In function 'void fast_long_increment_function(zval*)': /usr/include/php/Zend/zend_operators.h:446:68: error: '__builtin_saddl_overflow' was not declared in this scope if (UNEXPECTED(__builtin_saddl_overflow(Z_LVAL_P(op1), 1, &lresult))) { ^ /usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED' # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0) ^ /usr/include/php/Zend/zend_operators.h: In function 'void fast_long_decrement_function(zval*)': /usr/include/php/Zend/zend_operators.h:500:68: error: '__builtin_ssubl_overflow' was not declared in this scope if (UNEXPECTED(__builtin_ssubl_overflow(Z_LVAL_P(op1), 1, &lresult))) { ^ /usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED' # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0) ^ /usr/include/php/Zend/zend_operators.h: In function 'void fast_long_add_function(zval*, zval*, zval*)': /usr/include/php/Zend/zend_operators.h:554:80: error: '__builtin_saddl_overflow' was not declared in this scope if (UNEXPECTED(__builtin_saddl_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &lresult))) { ^ /usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED' # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0) ^ /usr/include/php/Zend/zend_operators.h: In function 'void fast_long_sub_function(zval*, zval*, zval*)': /usr/include/php/Zend/zend_operators.h:657:80: error: '__builtin_ssubl_overflow' was not declared in this scope if (UNEXPECTED(__builtin_ssubl_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &lresult))) { ^ /usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED' # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0) ^ make: *** [swoole_coroutine.lo] Error 1

  • /猫头鹰

    Please submit a full bug report, with preprocessed source if appropriate. See for instructions. cc: internal compiler error: Killed (program cc1) cc: internal compiler error: Killed (program cc1) Please submit a full bug report, with preprocessed source if appropriate. See for instructions. make: *** [swoole_coroutine_util.lo] Error 1 make: *** [swoole_process.lo] Error 1 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. make: *** [swoole_http_v2_server.lo] Error 1 make: *** [swoole_serialize.lo] Error 1 cc: internal compiler error: Killed (program cc1) cc: internal compiler error: Killed (program cc1) cc: internal compiler error: Killed (program cc1) cc: internal compiler error: Killed (program cc1) cc: internal compiler error: Killed (program cc1) cc: internal compiler error: Killed (program cc1) cc: internal compiler error: Killed (program cc1) cc: internal compiler error: Killed (program cc1) cc: internal compiler error: Killed (program cc1) cc: internal compiler error: Killed (program cc1) Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Please submit a full bug report, with preprocessed source if appropriate. See for instructions. cc: internal compiler error: Killed (program cc1) cc: internal compiler error: Killed (program cc1) cc: internal compiler error: Killed (program cc1) cc: internal compiler error: Killed (program cc1) cc: internal compiler error: Killed (program cc1) Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Please submit a full bug report, with preprocessed source if appropriate. See for instructions. make: *** [swoole_channel_coro.lo] Error 1 make: *** [swoole_event.lo] Error 1 make: *** [swoole_timer.lo] Error 1 make: *** [swoole_process_pool.lo] Error 1 make: *** [swoole_buffer.lo] Error 1 make: *** [swoole_http_v2_client.lo] Error 1 make: *** [swoole_mysql.lo] Error 1 make: *** [swoole_redis_server.lo] Error 1 make: *** [swoole_mmap.lo] Error 1 make: *** [swoole_channel.lo] Error 1 make: *** [swoole_ringqueue.lo] Error 1 make: *** [swoole_msgqueue.lo] Error 1 make: *** [swoole_trace.lo] Error 1 make: *** [src/network/TaskWorker.lo] Error 1 make: *** [src/network/ReactorProcess.lo] Error 1 [root@iZbp15p5zlb54utw2552fbZ swoole-src-4.0.0]#