MineAdmin
MineAdmin copied to clipboard
[QUESTION] macOS15.5. swoole6. 开启设置work数为1 php watch 热更 进程数莫名多了
i9(8核16线程) macos 15 swoole6 开启work数为1 php watch 热更 通过ps auc|grep php 有17个 热更就会出现端口被占用情况
Thanks for opening your first issue here! Be sure to follow the issue template! 感谢您在这里反馈第一个问题!请务必遵循问题模板!
Hello @adaipan! I'm Dosu, here to help you tackle bugs, answer questions, and navigate your way to becoming a contributor. I'm glad to assist while you wait for a human maintainer. How can I help you today?
在 macOS 上运行 MineAdmin 时,可能会出现进程数意外增加的问题,尤其是在使用 Swoole6 并设置 worker 数为 1 的情况下。以下是一些可能的解决方案和注意事项:
-
Worker 数配置: 确保在
config/autoload/server.php中正确配置了Constant::OPTION_WORKER_NUM。在调试模式下 (APP_DEBUG为 true),worker 数应为 1,否则应根据 CPU 核心数设置 [1]。 -
进程管理脚本: 检查
php watch命令的进程管理脚本,确保killOldProcess()和forceKill()函数正确终止旧进程。这些函数会尝试通过 PID 文件和命令行强制终止进程 [2]。 -
端口配置: 确保
.env文件中的VITE_APP_PORT设置为未被占用的端口,默认值为2888。同时检查docker-compose.yml中的端口配置,避免与其他服务端口冲突 [3][4]。
如果这些配置和脚本没有解决问题,可能需要进一步检查 Swoole6 在 macOS 上的已知问题或限制,特别是与进程管理相关的部分。
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
推荐用 hyperf/watcher