swoole学习过程中踩到的坑

来源:互联网 发布:js获取input的type 编辑:程序博客网 时间:2024/06/11 08:53

swManager_loop(:272): wait() failed.

[2017-09-02 13:41:19 #8475.2]   NOTICE  Server is shutdown now.[2017-09-02 13:41:19 $8476.0]   ERROR   swManager_loop(:272): wait() failed. Error: Interrupted system call[4].

当前版本是1.8.11,在论坛中,有人也出现过这个问题,后来通过升级Swoole扩展的版本解决。
该错误不会影响到程序执行。

swFactoryProcess_finish (ERROR 1004)

 ERROR   swFactoryProcess_finish (ERROR 1004): send 5 byte failed, because session#1 is closed.

看错误信息,应该是指发送5byte的数据错误,原因是会话1已经关闭。

后来发现我的onclose回调中,有一句返回值$server->send($fd,"close");。连接都已经关闭了,然后再发送close(刚好5字节),就会报错。

swoole_server must run at php_cli environment.

必须以shell的形式执行,php里面只能通过exec函数去执行响应的php脚本才行。

使用swoole_set_process_name或者cli_set_process_title设置进程名称报错

在终端报错信息

PHP Fatal error:  Uncaught exception 'ErrorException' with message 'cli_set_process_title(): cli_set_process_title had an error: Not initialized correctly' in xxxx.php:94

macOs会遇到此问题,是macos因为安全问题,有些功能给禁止了,即时sudo了也不行,但是换了Linux系统,就可以

[root@227test WEDO_EZSVS_COM]# ps aux | grep mjroot     22004  0.2  0.8 513572 65632 pts/1    Tl   14:07   0:00 mjsystemroot     22011  0.0  0.3 439672 29284 pts/1    T    14:07   0:00 php artisan mj startroot     22017  0.0  0.3 442020 29556 pts/1    T    14:07   0:00 php artisan mj startroot     24954  0.0  0.0 112644   964 pts/1    S+   14:09   0:00 grep --color=auto mj
原创粉丝点击