0

In Laravel, you can set the cache to Redis. However, when I clear the cache with php artisan cache:clear, I get the error: ERR unknown command 'FLUSHDB'

I know what the problem is because I have disabled the command as one should do for best practice.

But I'm not sure what to do. Should I activate the command so I can use redis as cache?

Philipp Mochine
  • 155
  • 1
  • 10
  • 1
    You disabled the command before, but now you want to use it. So you enable it again. That's too simple. – Michael Hampton Aug 26 '20 at 15:06
  • @MichaelHampton ok I wasn't sure if it's a big no no – Philipp Mochine Aug 26 '20 at 15:12
  • The best practice is to _rename_ the command, not necessarily _disable_ it. – Michael Hampton Aug 26 '20 at 15:12
  • @MichaelHampton Well sorry, I was wrong to say that I *disabled* it. With `rename-command FLUSHDB ""` I just renamed it to an empty string. However, since I'm using a framework, I'm not able to change the name of the function. (https://github.com/illuminate/cache/blob/master/RedisStore.php#L217). So I need to bring this function back. Thank you for your help – Philipp Mochine Aug 26 '20 at 15:36

0 Answers0