326 Star 1.6K Fork 345

GVPswoole / swoole-src

 / 详情

常识在windows subsystem for linux《ubuntu16.04》下跑swoole出现了下面的问题

Done
Opened this issue  
2017-08-19 23:17

一、环境
系统: windows subsystem for linux
PHP : 7.0.22
二、代码

<?php
$serv = new Swoole\Server("127.0.0.1", 9501);

//设置服务器参数
$serv->set(array(
    'worker_num' => 8,   //工作进程数量
    'daemonize' => true, //是否作为守护进程
));

//设置事件回调函数
$serv->on('connect', function ($serv, $fd) {
    echo "Client:Connect.\n";
});

$serv->on('receive', function ($serv, $fd, $reactor_id, $data) {
    $serv->send($fd, 'Swoole: ' . $data);
    $serv->close($fd);
});

$serv->on('close', function ($serv, $fd) {
    echo "Client: Close.\n";
});

//启动服务器
$serv->start();

三、报错代码:
WARNING swSignalfd_setup: signalfd() failed. Error: Function not implemented

最后感谢韩大神提供的swoole,感谢开发组打磨swoole。

Comments (2)

lijiuhui created 任务

subsystem 存在BUG,导致swoole的编译检测判断错误,请自行修改config.h去掉HAVE_SIGNALFD宏。

韩天峰 closed 任务

Sign in to comment

Status
Assignees
Milestones
Pull Requests
Successfully merging a pull request will close this issue.
Branches
Planed to start   -   Planed to end
-
Top level
Priority
参与者(2)
C
1
https://gitee.com/swoole/swoole.git
git@gitee.com:swoole/swoole.git
swoole
swoole
swoole-src

Search