Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-static method Redis::hGet() cannot be called statically #11

Closed
yes8080 opened this issue Jan 27, 2018 · 6 comments
Closed

Non-static method Redis::hGet() cannot be called statically #11

yes8080 opened this issue Jan 27, 2018 · 6 comments

Comments

@yes8080
Copy link

yes8080 commented Jan 27, 2018

Windows下LastActivedAtHelper的Redis路径错误
larabbs\app\Models\Traits\LastActivedAtHelper.php
delete : use Redis;
add : use Illuminate\Support\Facades\Redis;

@Jeepin-Ann
Copy link

我尝试过修改。最后提示我"Connection refused [tcp://127.0.0.1:6379]",折腾了很久,还是解决不了问题,折腾的我都进行不下去了。

@LeoRoll
Copy link

LeoRoll commented Sep 6, 2018

if you deploy on your own computer and use sublime text, "use Redis" in file larabbs\app\Models\Traits\LastActivedAtHelper.php has no problem. you may replace "use Redis" with "use Illuminate\Support\Facades\Redis" on the contrary if you deploy on the remote server.

@LeoRoll
Copy link

LeoRoll commented Sep 6, 2018

@Jeepin-Ann maybe you should change REDIS_HOST=127.0.0.1 to REDIS_HOST=redis in .env that file under your project.

@zoulux
Copy link

zoulux commented Nov 4, 2018

use Redis; 和 use Illuminate\Support\Facades\Redis; 有什么区别,确实解决了我的问题,但是还想问一下他俩的区别

@liyu001989
Copy link
Collaborator

@zoulux 没区别,是个 alias 的关系

@tashuo
Copy link

tashuo commented May 22, 2019

predis扩展与laravel redis别名的冲突,如果PHP环境安装有predis扩展,use Redis首先会寻找到根命名空间的redis扩展

@yes8080 yes8080 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants