windows下 Call to undefined function posix_getpid() in ……\Workerman\Worker.php 的解决方法

简介: windows下 Call to undefined function posix_getpid() in ……\Workerman\Worker.php 的解决方法

windows(win10)下Workerman运行报错: Call to undefined function posix_getpid() in ……\Workerman\Worker.php

问题还原


在windows中调用运行workerman时调用stopAll()时报错

Call to undefined function posix_getpid() in ……\Workerman\Worker.php:1830

问题原因


posix_getpid函数依赖于POSIX扩展,而POSIX扩展不支持在Windowns中使用。

posix_getpid函数用于获取当前php进程pid,所以寻找其在windows下的替代方法。最终找到getmypid方法,这个方法在所有平台通用两者的具体差别暂不考虑。

解决方法


将报错处代码的posix_getpid方法替换为getmypid方法就好了

image.png

目录
相关文章
|
数据采集 自然语言处理 Devops
ToolLearning Eval:CodeFuse发布首个中文Function Call的大语言模型评测基准!🚀
CodeFuse发布了首个面向ToolLearning领域的中文评测基准ToolLearning-Eval,以帮助开发者跟踪ToolLearning领域大模型的进展,并了解各个ToolLearning领域大模型的优势与不足。ToolLearning-Eval按照Function Call流程进行划分,包含工具选择、工具调用、工具执行结果总结这三个过程,方便通用模型可以对各个过程进行评测分析。
1418 0
|
PHP
windows11 vscode 配置 php环境
windows11 vscode 配置 php环境
204 0
|
机器学习/深度学习 并行计算 异构计算
WINDOWS安装eiseg遇到的问题和解决方法
通过本文的详细步骤和问题解决方法,希望能帮助你顺利在 Windows 系统上安装和运行 EISeg。
758 2
Fatal error: Call to undefined function openssl_pkey_get_private()
Fatal error: Call to undefined function openssl_pkey_get_private()
238 0
|
弹性计算 安全 网络安全
阿里云国际版无法远程连接Windows服务器的解决方法
阿里云国际版无法远程连接Windows服务器的解决方法
|
PHP Windows
【Azure App Service for Windows】 PHP应用出现500 : The page cannot be displayed because an internal server error has occurred. 错误
【Azure App Service for Windows】 PHP应用出现500 : The page cannot be displayed because an internal server error has occurred. 错误
316 1
|
PHP 开发工具 git
【Azure 应用服务】在 App Service for Windows 中自定义 PHP 版本的方法
【Azure 应用服务】在 App Service for Windows 中自定义 PHP 版本的方法
249 1
|
文字识别 Linux Swift
多图理解,更懂中文,支持function call的Phi-3.5来了!
微软继今年4月推出Phi-3系列小型语言模型后,又一鼓作气三连发布并开源其「小而美」系列 Phi-3.5模型!
Windows7电脑启动时提示文件winload.exe无法验证其数字签名,错误代码0xc0000428的解决方法
Windows7电脑启动时提示文件winload.exe无法验证其数字签名,错误代码0xc0000428的解决方法
|
Windows
Windows批处理(BAT)文件执行时“一闪而过或闪退”问题及解决方法
Windows批处理(BAT)文件执行时“一闪而过或闪退”问题及解决方法
9909 1

热门文章

最新文章