thinkphp6运行swoole报错

转载请注明出处,如果您觉得文章有用,就赏我个鸡腿吧!

问题

# php think swoole start

启动swoole报错如下:

[TypeError]                                                                                                                                                                               
  Argument 1 passed to think\swoole\PidManager::__construct() must be of the type string, null given, called in /home/htdocs/tp6/vendor/topthink/think-swoole/src/command/Server.php on li  
  ne 43

分析过程

报错信息
根据错误信息查看源代码

vim /home/htdocs/tp6/vendor/topthink/think-swoole/src/command/Server.php

在这里插入图片描述
发现应该有swoole.php这个配置文件,而config中并没有发现此文件
于是…

find / -name swoole.php

在这里插入图片描述

解决方法

将其复制到config目录中

cp vendor/topthink/think-swoole/src/config/swoole.php config/swoole.php

在启动,已正常运行

# php think swoole start
# 提示如下,表示已正常运行
Starting swoole http server...
Swoole http server started: <http://127.0.0.1:80>
You can exit with `CTRL-C`
  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值