FreeBSD 12 PHP 8.0.0 起动不了 Workerman

Alu
 Workerman[start.php] start in DEBUG mode
------------------------------------------- WORKERMAN --------------------------------------------
Workerman version:4.0.17          PHP version:8.0.1
-------------------------------------------- WORKERS ---------------------------------------------
proto   user            worker          listen                      processes    status
tcp     root            ApisBusiness    none                        1             [OK]
tcp     root            ApisGateway     text://0.0.0.0:5850         2             [OK]
tcp     root            ApisRegister    text://0.0.0.0:5800         1             [OK]
tcp     root            ApiWebSocket    websocket://0.0.0.0:5818    1             [OK]
--------------------------------------------------------------------------------------------------
Press Ctrl+C to stop. Start success.

Warning: stream_socket_client(): Unable to connect to tcp://127.0.0.1:5800 (Connection refused) in /usr/home/Worker/Workerman/Connection/AsyncTcpConnection.php on line 190

Warning: stream_socket_client(): Unable to connect to tcp://127.0.0.1:5800 (Connection refused) in /usr/home/Worker/Workerman/Connection/AsyncTcpConnection.php on line 190
1995 4 0
4个回答

Alu

我更新了一下就正常使用了。
再试又不行,不知道怎么回事

  • walkor 2021-01-22

    贴下start_xxxgateway.php 内容

Alu

@walkor: 麻烦帮我看下,配置应该没错吧。

<?php 

use \GatewayWorker\Gateway;
// gateway 进程,这里使用Text协议
$Gateway = new Gateway('Text://0.0.0.0:5850');
// gateway名称,status方便查看
$Gateway->name = 'ApisGateway';
// gateway进程数
$Gateway->count = 2;
// 本机ip,分布式部署时使用内网ip
$Gateway->lanIp = '127.0.0.1';
// 内部通讯起始端口,假如进程数=2,起始端口为4000 4001 
$Gateway->startPort = 5851;
// 服务注册地址
$Gateway->registerAddress = '127.0.0.1:5800';
// 心跳间隔
$Gateway->pingInterval = 300;
// 心跳数据
$Gateway->pingData = '{"type":"ping"}';
if (! defined('GLOBAL_START')) {
    Worker::runAll();
}
  • walkor 2021-01-22

    ApiWebSocket 5818 端口的启动文件也贴下

  • Alu 2021-01-22

    @1:在目录产生一个文件 php.core 一下子好几百M了

Alu

@walkor:

<?php 

use \GatewayWorker\Gateway;
// gateway 进程,这里使用Text协议,可以用telnet测试
$Gateway = new Gateway('Websocket://0.0.0.0:5818');
// gateway名称,status方便查看
$Gateway->name = 'ApiWebSocket';
// gateway进程数
$Gateway->count = 1;
// 本机ip,分布式部署时使用内网ip
$Gateway->lanIp = '127.0.0.1';
// 内部通讯起始端口,假如进程数=2,起始端口为4000 4001 
$Gateway->startPort = 5830;
// 服务注册地址
$Gateway->registerAddress = '127.0.0.1:5800';
// 心跳间隔
$Gateway->pingInterval = 300;
// 心跳数据
$Gateway->pingData = '{"type":"ping"}';

if (! defined('GLOBAL_START')) {
    Worker::runAll();
}
  • 暂无评论
walkor 打赏

start_register.php 里加一行代码

$register->reusePort = false;

试下

  • Alu 2021-01-22

    可以运行了,感谢!

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