为何我机器上安装了libevent,但是workerman使用的却是select?

小七他哥

我在机器上执行如下命令:

yum install libevent
已加载插件:fastestmirror
设置安装进程
Loading mirror speeds from cached hostfile
http://mirrors.cloud.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
尝试其他镜像。
To address this issue please refer to the below wiki article 

https://wiki.centos.org/yum-errors

If above article doesn't help to resolve this issue please use https://bugs.centos.org/.

epel                                                                         | 4.7 kB     00:00     
epel/primary_db                                                              | 6.9 MB     00:27     
http://mirrors.cloud.aliyuncs.com/centos/6/extras/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
尝试其他镜像。
http://mirrors.cloud.aliyuncs.com/centos/6/updates/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
尝试其他镜像。
包 libevent-1.4.13-4.el6.x86_64 已安装并且是最新版本
无须任何处理

但是我看 status 信息的时候却显示如下:

[root@iZ257wguph6Z diary]# php workerManApi/WebsocketServer.php status
Workerman[workerManApi/WebsocketServer.php] status 
----------------------------------------------GLOBAL STATUS----------------------------------------------------
Workerman version:4.0.19          PHP version:7.0.21
start time:2021-06-25 15:19:17   run 0 days 0 hours   
load average: 0, 0, 0            event-loop:\Workerman\Events\Select
1 workers       1 processes
worker_name       exit_status      exit_count
MyWebsocketWorker 0                0
----------------------------------------------PROCESS STATUS---------------------------------------------------
pid memory  listening                worker_name       connections send_fail timers  total_request qps    status
416 4M      websocket://0.0.0.0:8910 MyWebsocketWorker 3           0         0       4             0      [idle]
----------------------------------------------PROCESS STATUS---------------------------------------------------
Summary 4M      -                        -                 3           0         0       4             0      [Summary] 

看那个 event-loop,我期望使用 libevent ,该如何设置呢?

1358 3 0
3个回答

朕震惊了

你这个命令只是是装了libevent,但是没给php装libevent扩展。
就像你给服务器装了mysql,php要用mysql的话还要给php装mysql扩展。

  • 小七他哥 2021-06-25

    谢谢回答,我按你的意思去安装php的libevent扩展了,但是这个扩展的版本好像特别低,都不支持php7以上的,而且该库也没人维护,请问你用的是什么库呢?

evilk

php7,请使用event扩展,不要使用libevent扩展
两者性能没差

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