坑
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 mj
root 22004 0.2 0.8 513572 65632 pts/1 Tl 14:07 0:00 mjsystem
root 22011 0.0 0.3 439672 29284 pts/1 T 14:07 0:00 php artisan mj start
root 22017 0.0 0.3 442020 29556 pts/1 T 14:07 0:00 php artisan mj start
root 24954 0.0 0.0 112644 964 pts/1 S+ 14:09 0:00 grep --color=auto mj