在redhat 6.3系统下,安装php7.3.10后,用最新的workerman-gateway,启动失败

heroking

在redhat 6.3系统下,安装php7.3.10后,用最新的workerman-gateway,启动失败。
提示端口被占用,但是端口绝对未占用的。
 
经过查看日志,未发现具体原因,请求支援!!!!
个人感觉与系统有关系,不知道是不是?

 Fatal error: Uncaught Exception: Address already in use in /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php:2208
Stack trace:
#0 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(1473): Workerman\Worker->listen()
#1 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(1320): Workerman\Worker::forkOneWorkerForLinux(Object(GatewayWorker\Gateway))
#2 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(1294): Workerman\Worker::forkWorkersForLinux()
#3 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(1624): Workerman\Worker::forkWorkers()
#4 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(1573): Workerman\Worker::monitorWorkersForLinux()
#5 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(511): Workerman\Worker::monitorWorkers()
#6 /sh/wang/GatewayWorker/start.php(37): Workerman\Worker::runAll()
#7 {main}
  thrown in /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php on line 2208

Fatal error: Uncaught Exception: Address already in use in /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php:2208
Stack trace:
#0 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(1473): Workerman\Worker->listen()
#1 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(1320): Workerman\Worker::forkOneWorkerForLinux(Object(GatewayWorker\Gateway))
#2 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(1294): Workerman\Worker::forkWorkersForLinux()
#3 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(1624): Workerman\Worker::forkWorkers()
#4 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(1573): Workerman\Worker::monitorWorkersForLinux()
#5 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(511): Workerman\Worker::monitorWorkers()
#6 /sh/wang/GatewayWorker/start.php(37): Workerman\Worker::runAll()
#7 {main}
  thrown in /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php on line 2208

Fatal error: Uncaught Exception: Address already in use in /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php:2208
Stack trace:
#0 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(1473): Workerman\Worker->listen()
#1 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(1320): Workerman\Worker::forkOneWorkerForLinux(Object(GatewayWorker\Gateway))
#2 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(1294): Workerman\Worker::forkWorkersForLinux()
#3 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(1624): Workerman\Worker::forkWorkers()
#4 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(1573): Workerman\Worker::monitorWorkersForLinux()
#5 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(511): Workerman\Worker::monitorWorkers()
#6 /sh/wang/GatewayWorker/start.php(37): Workerman\Worker::runAll()
#7 {main}
  thrown in /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php on line 2208

Fatal error: Uncaught Exception: Address already in use in /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php:2208
Stack trace:
#0 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(1473): Workerman\Worker->listen()
#1 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(1320): Workerman\Worker::forkOneWorkerForLinux(Object(GatewayWorker\Gateway))
#2 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(1294): Workerman\Worker::forkWorkersForLinux()
#3 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(1624): Workerman\Worker::forkWorkers()
#4 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(1573): Workerman\Worker::monitorWorkersForLinux()
#5 /sh/wang/GatewayWorker/vendor/workerman/workerman/Worker.php(511): Workerman\Worker::monitorWorkers()
#6 /sh/wang/GatewayWorker/start.php(37): Workerman\Worker::runAll()
2282 2 0
2个回答

walkor 打赏

应该是start_gateway.php中的startPort指定范围的端口被占用了。改成其它端口就好了

  • 暂无评论
walkor 打赏

启动后报错类似如下:

php start.php start
PHP Warning:  stream_socket_server(): unable to connect to tcp://xx.xx.xx.xx:xxxx (Address already in use) in ...workerman/Worker.php on line xxxx
关键字: Address already in use

失败原因:

端口被占用,无法启动。

可以通过命令netstat -anp | grep 端口号来找出哪个程序占用了端口。 然后停止对应的程序释放端口解决。

如果不能停止对应端口的程序,可以通过更换workerman的端口解决。

如果是Workerman占用的端口,又无法通过stop命令停止(一般是丢失pid文件或者主进程被开发者kill了导致),可以通过运行以下两个命令杀死Workerman进程。

killall php
ps aux|grep WorkerMan|awk '{print $2}'|xargs kill -9
如果确实没有程序监听这个端口,那么可能是开发者在workerman里设置了两个或两个以上的监听,并且监听的端口相同导致,请开发者自行检查启动脚本是否监听了相同的端口。
 
http://doc.workerman.net/faq/workerman-start-fail.html

  • heroking 2019-10-18

    感谢大大的回复。但是你说的方法我都试过了。我已经排除了其他程序占用端口的可能,因为更换端口也是一样的问题。感觉是workerman启动子线程失败,然后又自动退出。一直循环启动。

    我用了2台redhat 6.3的系统都存在一样的问题。最后不得不换了一台ubuntu的系统,运行完全正常。
    因此,我认为可能与系统或某个依赖库有关系。

  • shaohualin 2019-11-08

    @6378:我在ubuntu 19.04 下还是报这个错.难道真挑系统???

年代过于久远,无法发表回答
×
🔝