原文:laravel項目出現Non-static method Redis::hGet() cannot be called statically的解決方法

早上ytkah在配置laravel項目中出現Non static method Redis::hGet cannot be called statically錯誤提示,很顯然這是redis出問題了,search了一下大概是因為PHP自帶了redis拓展和predis沖突了導致的。打開composer.json看到確實有一個predis擴展,代碼如下。那就好辦了 有沖突就要進行調解 為了項目的完整 ...

2018-07-14 10:53 0 1566 推薦指數:

查看詳情

Cannot make a static reference to the non-static method解決方法

報錯原因:在一個類中寫了一個public String getContent()方法和一個main()方法,getContent()方法中包含了getClass()方法,在main()方法中直接調用了getContent()就出現如題的錯誤。這樣一樣 解決方法:先實例化類,然后再 ...

Tue Jan 12 18:42:00 CST 2016 0 1899
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM