关于libevent扩展升级php7遇到的问题

youwuku

系统升级php7,libevent的PHP扩展 一直编译不过,后来在GitHub找了一个,能把so编译出来。结果最基本的timer都跑不起来,一直进程退出。后来把libevent.so注释掉,换装event扩展,成功!

1601 4 0
4个回答

keytehu

手册说了,libevent扩展不支持php7。统一用event扩展

  • youwuku 2020-09-06

    没注意

  • youwuku 2020-09-07

    发现event走的不是epoll,是我处理的哪里不对吗?

youwuku

发现event走的不是epoll,是我处理的哪里不对吗?

strace: Process 63167 attached
16:55:49.212849 restart_syscall(<... resuming interrupted read ...>) = 0
16:55:57.219467 open("/xxxxxx/TimerConfig.ini", O_RDONLY) = 8
16:55:57.219709 fstat(8, {st_mode=S_IFREG|0664, st_size=734, ...}) = 0
16:55:57.219779 read(8, ";\346\204\217\345\234\250\346\236\204\345\273\272\344\270\200\344\270\252\345\210\206\345\270\203\345\274\217\347\232\204\345"..., 734) = 734
16:55:57.219896 close(8) = 0
16:55:57.220071 select(8, [7], [7], NULL, {tv_sec=1, tv_usec=0}) = 1 (out [7], left {tv_sec=0, tv_usec=999997})
16:55:57.220178 sendto(7, "add dist_start_timer_lock_key_db"..., 75, MSG_NOSIGNAL, NULL, 0) = 75
16:55:57.220302 select(8, [7], [], NULL, {tv_sec=1, tv_usec=0}) = 1 (in [7], left {tv_sec=0, tv_usec=999907})
16:55:57.220471 recvfrom(7, "NOT_STORED\r\n", 32768, 0, NULL, NULL) = 12
16:55:57.220551 open("/sss/DistTimer09-07.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = 8
16:55:57.220607 fstat(8, {st_mode=S_IFREG|0666, st_size=426842, ...}) = 0
16:55:57.220641 lseek(8, 0, SEEK_CUR) = 0
16:55:57.220674 lseek(8, 0, SEEK_CUR) = 0
16:55:57.220707 write(8, "--\346\232\202\346\227\266\346\227\240timer\345\273\272\347\253\213-!!!-\n", 28) = 28
16:55:57.220814 close(8) = 0
16:55:57.220896 select(8, [7], [7], NULL, {tv_sec=1, tv_usec=0}) = 1 (out [7], left {tv_sec=0, tv_usec=999997})
16:55:57.220984 sendto(7, "add dist_start_timer_lock_key_db"..., 53, MSG_NOSIGNAL, NULL, 0) = 53
16:55:57.221169 select(8, [7], [], NULL, {tv_sec=1, tv_usec=0}) = 1 (in [7], left {tv_sec=0, tv_usec=999998})
16:55:57.221282 recvfrom(7, "NOT_STORED\r\n", 32768, 0, NULL, NULL) = 12
16:55:57.221360 open("/sss/DistTimer09-07.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = 8
16:55:57.221425 fstat(8, {st_mode=S_IFREG|0666, st_size=426870, ...}) = 0
16:55:57.221462 lseek(8, 0, SEEK_CUR) = 0
16:55:57.221494 lseek(8, 0, SEEK_CUR) = 0
16:55:57.221546 write(8, "--\346\232\202\346\227\266\346\227\240timer\345\273\272\347\253\213-!!!-\n", 28) = 28
16:55:57.221596 close(8) = 0
16:55:57.221678 poll([{fd=5, events=POLLIN}], 1, 9992) = 0 (Timeout)
16:56:07.223916 open("xxxxx/TimerConfig.ini", O_RDONLY) = 8
16:56:07.224082 fstat(8, {st_mode=S_IFREG|0664, st_size=734, ...}) = 0
16:56:07.224161 read(8, ";\346\204\217\345\234\250\346\236\204\345\273\272\344\270\200\344\270\252\345\210\206\345\270\203\345\274\217\347\232\204\345"..., 734) = 734
16:56:07.224247 close(8) = 0
16:56:07.224368 select(8, [7], [7], NULL, {tv_sec=1, tv_usec=0}) = 1 (out [7], left {tv_sec=0, tv_usec=999997})
16:56:07.224477 sendto(7, "add dist_start_timer_lock_key_db"..., 75, MSG_NOSIGNAL, NULL, 0) = 75
16:56:07.224662 select(8, [7], [], NULL, {tv_sec=1, tv_usec=0}) = 1 (in [7], left {tv_sec=0, tv_usec=999897})
16:56:07.224856 recvfrom(7, "NOT_STORED\r\n", 32768, 0, NULL, NULL) = 12
16:56:07.224945 open("/sss/DistTimer09-07.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = 8
16:56:07.224995 fstat(8, {st_mode=S_IFREG|0666, st_size=426898, ...}) = 0
16:56:07.225042 lseek(8, 0, SEEK_CUR) = 0
16:56:07.225086 lseek(8, 0, SEEK_CUR) = 0
16:56:07.225139 write(8, "--\346\232\202\346\227\266\346\227\240timer\345\273\272\347\253\213-!!!-\n", 28) = 28
16:56:07.225205 close(8) = 0
16:56:07.225300 select(8, [7], [7], NULL, {tv_sec=1, tv_usec=0}) = 1 (out [7], left {tv_sec=0, tv_usec=999975})
16:56:07.225385 sendto(7, "add dist_start_timer_lock_key_db"..., 53, MSG_NOSIGNAL, NULL, 0) = 53
16:56:07.225441 select(8, [7], [], NULL, {tv_sec=1, tv_usec=0}) = 1 (in [7], left {tv_sec=0, tv_usec=999942})
16:56:07.225550 recvfrom(7, "NOT_STORED\r\n", 32768, 0, NULL, NULL) = 12
16:56:07.225604 open("/sss/DistTimer09-07.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = 8
16:56:07.225647 fstat(8, {st_mode=S_IFREG|0666, st_size=426926, ...}) = 0
16:56:07.225699 lseek(8, 0, SEEK_CUR) = 0
16:56:07.225832 lseek(8, 0, SEEK_CUR) = 0
16:56:07.225885 write(8, "--\346\232\202\346\227\266\346\227\240timer\345\273\272\347\253\213-!!!-\n", 28) = 28

  • 暂无评论
keytehu

运行 php -m 看下event扩展是否安装成功。

如果安装成功,要重启下workerman才能生效。

  • 暂无评论
youwuku

php7 -i|grep event

event
libevent2 headers version => 2.1.12-stable
eventfd => enabled

php7 -m

[PHP Modules]
bcmath
Core
ctype
curl
date
dom
event
fileinfo
filter
gd
hash
iconv
json
libxml

  • 暂无评论
年代过于久远,无法发表回答
🔝