easy-swoole / easyswoole

swoole,easyswoole,swoole framework
https://www.easyswoole.com/
Apache License 2.0
4.73k stars 511 forks source link

按照文档里面配置全局变量 出现错误 #532

Closed LOVE2CMOL closed 2 years ago

LOVE2CMOL commented 2 years ago

http://www.easyswoole.com/HttpServer/global.html 环境是WSL2

直接Copy文档的代码

请求接口报错

Call to undefined function EasySwoole\Spl\defer()
#0 /mnt/d/mygit/BlueSkyProject/server/easyswoole/vendor/easyswoole/spl/src/SplContextArray.php(83): EasySwoole\Spl\SplContextArray->cid()
#1 /mnt/d/mygit/BlueSkyProject/server/easyswoole/EasySwooleEvent.php(35): EasySwoole\Spl\SplContextArray->loadArray()
#2 [internal function]: EasySwoole\EasySwoole\EasySwooleEvent::EasySwoole\EasySwoole\{closure}()
#3 /mnt/d/mygit/BlueSkyProject/server/easyswoole/vendor/easyswoole/easyswoole/src/Core.php(262): call_user_func()
#4 [internal function]: EasySwoole\EasySwoole\Core->EasySwoole\EasySwoole\{closure}()
#5 {main}

···· main server SWOOLE_WEB listen address 0.0.0.0 listen port 9501 worker_num 8 reload_async true max_wait_time 30 pid_file /tmp/pid.pid log_file /tmp/EasySwooleLog/swoole.log user love2cmol swoole version 4.8.8 php version 8.1.3 easyswoole version 3.5.1 run mode dev temp dir /tmp log dir /tmp/EasySwooleLog ····

image image image image image

LOVE2CMOL commented 2 years ago

easyswoole\vendor\easyswoole\spl\src\SplContextArray.php:98

image 这玩意改成这样 image 就可以跑了

但我不知道会不会出问题 🤣🤣🤣🤣🤣

刚刚接触swoole 准备拿来做微服务 还有一坨shi山准备迁移过来😂😂

Player626 commented 2 years ago

打开你swoole的短命名

LOVE2CMOL commented 2 years ago

万分感谢 弄好了