I am trying to get redis working in my Laravel project on Mac.
Here is what I did so far:
1) I ran "composer require predis/predis" succesfully
2) I can see the predis folder in vendor folder
3) My CACHE_DRIVER has been set to redis in the cache.php and .env file
When I try to run redis in my project, I get the following error:
Connection refused [tcp://127.0.0.1:6379]
Based on what I read online, it seems like my redis server is not started. How can I start it?
To start Redis client, open the terminal and type the command redis-cli. This will connect to your local server and now you can run any command. In the above example, we connect to Redis server running on the local machine and execute a command PING, that checks whether the server is running or not.
Installing Redis on Mac There are two ways to install Redis on Mac: Installing Redis from scratch. Using package management software, like Homebrew.
You can install the redis server via brew install redis
. Be sure to start the redis daemon by running brew services start redis
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With