swoole php不能用cache,Swoole::$php->runMVC() 出错, resource[cache/session] not found

松元明
2023-12-01

使用Swoole的时候出现以下问题,如何解决呢?不是太懂,希望高手们能帮帮忙!谢谢了!

是运行https://github.com/matyhtf/webim里的开源项目:matyhtf/webim

ubuntu 14.04 LTS 64位

php版本为:PHP 7.1.2 (cli)

swoole redis php扩展已成功加载

swoole为2.0.1beta版本,redis为github上phpredis的php7分支

webim_server.php服务器已开启,但提示

PHP Notice:  Undefined index: storage in /home/peyogoat/Downloads/webim/src/Server.php on line 51

Notice: Undefined index: storage in /home/peyogoat/Downloads/webim/src/Server.php on line 51

PHP Warning:  Swoole\Server::on(): Unknown event types[Timer] in /home/peyogoat/Downloads/webim/vendor/matyhtf/swoole_framework/libs/Swoole/Network/Server.php on line 380

Warning: Swoole\Server::on(): Unknown event types[Timer] in /home/peyogoat/Downloads/webim/vendor/matyhtf/swoole_framework/libs/Swoole/Network/Server.php on line 380

出错的代码为下面最后一句:

Swoole\Loader::vendorInit();

Swoole::$php->config->setPath(ROOT_PATH . '/configs');

Swoole::$php->runMVC();

错误提示:

Swoole\Exception\NotFound thrown with message "Swoole\Factory: resource[cache/session] not found."

Stacktrace:

#8 Swoole\Exception\NotFound in /home/nobody/nginxroot/webim/vendor/matyhtf/swoole_framework/libs/Swoole/Factory.php:18

#7 Swoole\Factory:__callStatic in /home/nobody/nginxroot/webim/vendor/matyhtf/swoole_framework/libs/Swoole/Session.php:48

#6 Swoole\Session:__construct in /home/nobody/nginxroot/webim/vendor/matyhtf/swoole_framework/libs/factory/session.php:21

#5 require in /home/nobody/nginxroot/webim/vendor/matyhtf/swoole_framework/libs/Swoole/Swoole.php:410

#4 Swoole:loadModule in /home/nobody/nginxroot/webim/vendor/matyhtf/swoole_framework/libs/Swoole/Swoole.php:377

#3 Swoole:__get in /home/nobody/nginxroot/webim/vendor/matyhtf/swoole_framework/libs/Swoole/Object.php:43

#2 Swoole\Object:__get in /home/nobody/nginxroot/webim/webroot/apps/controllers/Page.php:10

#1 App\Controller\Page:index in /home/nobody/nginxroot/webim/vendor/matyhtf/swoole_framework/libs/Swoole/Swoole.php:701

#0 Swoole:runMVC in /home/nobody/nginxroot/webim/webroot/index.php:15

 类似资料: