首页
下载
文档
社区
视频
捐赠
源代码
赞助商
AOT 编译器
AI 助理
商业产品
PHP AOT 原生编译器
Swoole-Compiler 代码加密器
CRMEB 新零售社交电商系统
登录
注册
全部
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
发表新帖
swoole-cli-v5.0.1-linux-x64.tar.xz 发现的新问题。
### 问题描述 我同样的程序代码,用了 SWOOLE-CLI 5.0.1 就出现了以下的提示,用5.0.0 或 4.8.X的就没有任何问题?是不是5.0.1又出现了BUG?? ``` Fatal error: Uncaught TypeError: (null)(): supplied resource is not a valid stream resource in [no active file]:0 Stack trace: #0 {main} thrown in [no active file] on line 0 ``` ### Swoole版本,PHP版本,以及操作系统版本信息 `swoole-cli-v5.0.1-linux-x64.tar.xz` ### 相关代码 运行后提示: ``` Fatal error: Uncaught TypeError: (null)(): supplied resource is not a valid stream resource in [no active file]:0 Stack trace: #0 {main} thrown in [no active file] on line 0 ```
发布于3年前 · 25 次浏览 · 来自
提问
自在侠
### 问题描述 我同样的程序代码,用了 SWOOLE-CLI 5.0.1 就出现了以下的提示,用5.0.0 或 4.8.X的就没有任何问题?是不是5.0.1又出现了BUG?? ``` Fatal error: Uncaught TypeError: (null)(): supplied resource is not a valid stream resource in [no active file]:0 Stack trace: #0 {main} thrown in [no active file] on line 0 ``` ### Swoole版本,PHP版本,以及操作系统版本信息 `swoole-cli-v5.0.1-linux-x64.tar.xz` ### 相关代码 运行后提示: ``` Fatal error: Uncaught TypeError: (null)(): supplied resource is not a valid stream resource in [no active file]:0 Stack trace: #0 {main} thrown in [no active file] on line 0 ```
赞
0
收藏
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
登录
后参与评论
评论
2022-11-16
Rango
可能与`php-8.1.12`的升级有关,是什么样的代码会导致上面的错误?请提供一段最简可重现的代码。
赞
0
回复
2022-11-16
自在侠
我提供一下片段的代码: 主要是在执行KILL 关闭进程ID的时候,出现的报错;虽然有提示,但并不影响我程序进程ID的关闭; 附截图  代码: case 'stop': if ($mode === '-g') { static::$_gracefulStop = true; $sig = \SIGHUP; static::log("Workerman[$start_file] is gracefully stopping ..."); } else { static::$_gracefulStop = false; $sig = \SIGINT; static::log("Workerman[$start_file] is stopping ..."); } //SWOOLE-CLI 5.0.1 大概是从这里开始报错 // Send stop signal to master process. $master_pid && \posix_kill($master_pid, $sig); // Timeout. $timeout = 5; $start_time = \time(); // Check master process is still alive? while (1) { $master_is_alive = $master_pid && \posix_kill((int) $master_pid, 0); if ($master_is_alive) { // Timeout? if (!static::$_gracefulStop && \time() - $start_time >= $timeout) { static::log("Workerman[$start_file] stop fail"); exit; } // Waiting amoment. \usleep(10000); continue; } // Stop success. //以下也能正确输出(可以看截图) static::log("Workerman[$start_file] stop success"); if ($command === 'stop') { exit(0); } if ($mode === '-d') { static::$daemonize = true; } break; } break;
赞
0
回复
2022-11-16
自在侠

赞
0
回复