Channel/Client 当服务端未启动时报错

秘密花园

问题描述

当服务端未开启时,客户端报错。

Waring channel connection closed and try to reconnect
PHP Fatal error:  Cannot declare class Workerman\Protocols\Frame, because the name is already in use in /www/wwwroot/test/workerman/workerman/workerman/Protocols/Frame.php on line 21

Fatal error: Cannot declare class Workerman\Protocols\Frame, because the name is already in use in /www/wwwroot/test/workerman/workerman/workerman/Protocols/Frame.php on line 21
Worker[53949] process terminated with ERROR: E_COMPILE_ERROR "Cannot declare class Workerman\Protocols\Frame, because the name is already in use in /www/wwwroot/test/workerman/workerman/workerman/Protocols/Frame.php on line 21"
worker[Test:53949] exit with status 65280

程序代码或配置

Client::connect();
Client::on("data", function($event_data){
global $clients;
$clients[$event_data['id']] = $event_data['time'];
});

重现问题的步骤

服务端没开,连接时报错。

操作系统环境及workerman/webman等具体版本

PHP version:7.4.33

Workerman version:4.1.11

Channel/Client
@version 1.0.7

380 2 0
2个回答

walkor

本地测试没出现你说的问题

  • 暂无评论
admin

多次require同一个文件导致的,请把你的编辑过的文件全部贴出来

  • 暂无评论
🔝