操作系统:macOS Monterey
PHP 版本:8.0.19
Workerman 版本:5.0.0(master)
相关描述:
使用 php workerman.php start -d
启动后命令失效。
复现步骤:
php workerman.php start -d
Workerman[workerman.php] start in DAEMON mode
----------------------------------------- WORKERMAN -----------------------------------------
Workerman version:5.0.0 PHP version:8.0.19 Event-loop:Workerman\Events\Select
------------------------------------------ WORKERS ------------------------------------------
proto user worker listen processes status
tcp admin none http://0.0.0.0:2345 4 [OK]
---------------------------------------------------------------------------------------------
Input "php workerman.php stop" to stop. Start success.
php workerman.php stop
Workerman[workerman.php] stop
Workerman[workerman.php] not run
感觉是概率问题,后面我把端口换成 2346
一直重复操作也没有复现。
但是 2345
端口已经是被占用了。
php workerman.php start
Workerman[workerman.php] start in DEBUG mode
stream_socket_server(): Unable to connect to tcp://0.0.0.0:2345 (Address already in use) in file .../src/Worker.php on line 2211
PHP Fatal error: Uncaught Exception: Address already in use in .../src/Worker.php:2213
...
https://www.workerman.net/doc/workerman/faq/stop-fail.html
停止失败排查手册 感觉是启动用户是admin,停止用户是另外一个用户导致的
都是 admin,到现在没遇到过上面的情况了,复现的概率极低
这个我之前好像遇到过,好像是守护进程模式下,然后代码发生了致命错误,就会这样