简体   繁体   English

无法打开 stream - 没有这样的文件或目录 - Lumen PHP

[英]failed to open stream - no such file or directory - Lumen PHP

We capture mobile device information along with jwt token generated for it and store it in mysql table.我们捕获移动设备信息以及为其生成的 jwt 令牌,并将其存储在 mysql 表中。

This is ensure the user is able to use the app on 1 or more devices allocated for the user as per the plan.这是为了确保用户能够在按照计划分配给用户的 1 台或多台设备上使用该应用程序。

There is situation where user logs out from the devices or we force the user to logout of the device by invalidating the token.存在用户从设备注销或我们通过使令牌无效来强制用户注销设备的情况。 In that case below code is executed to invalidate the jwt token.在这种情况下,执行以下代码以使 jwt 令牌无效。

try {
       JWTAuth::manager()->invalidate(new \Tymon\JWTAuth\Token($token), $forceForever = false);
}
catch (JWTException $e) {
}

Below is tech stack下面是技术栈

  • PHP 7.2 PHP 7.2
  • lumen流明
  • Redis Redis

Below image shown error occurs only with this api and not any other Api's.下图显示的错误仅发生在此 api 而不是任何其他 Api 上。 Not sure why its throwing an error related to cache.不知道为什么它会抛出与缓存相关的错误。

在此处输入图像描述

Seems like whenever sudo php artisan cache:clear is executed on server it starts to work and again from next day it fails.似乎每当sudo php artisan cache:clear在服务器上执行时它开始工作,并且从第二天开始再次失败。

please let me know whats the reason for it请让我知道这是什么原因

my lumen was using local cache for some reason i forgot to change to redis which i was supposed to use.由于某种原因,我的流明正在使用本地缓存,我忘记更改为我应该使用的 redis。 So now its fine.所以现在很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM