osherdo's avatar

verify Redis to run properly on Laravel 5

I am trying to create chat application (redis+nodejs+socket.io).

How can I know that Redis is installed?

i already installed dependencies (composer require predis/predis,hope this is the correct one for laravel)

Also run 'composer update'.

is there a way to make sure redis is installed for my project?

0 likes
5 replies
christopher's avatar

First of all Redis is not just a laravel package. Redis is a server software. You can check the version with

redis-server --version

Now if you want to check if redis is storing the keys, setup your redis code, and type redis-cli in your console. Then just click a bit around and you should see some lines with the stored keys in real time.

osherdo's avatar

tried to run the version check command on command prompt, but it gives me the following error:

'redis' is not recognized as an internal or external command,
operable program or batch file.

like I said above: I did installed dependencies and composer update command.

usamamashkoor's avatar

@osherdo i am also getting this error the same as you can you please tell me if you have fixed then how did you do that please kindly tell me it will be really appreciated. and @christopher if you know how how to fix this issue then please guide us on this Thanks in advance

basicmathz's avatar

Developers using Windows or generally not using homestead, you'll need to install redis server or you'll get the following error:

ConnectionException in AbstractConnection.php line 168: No connection could be made because the target machine actively refused it. [tcp://localhost:6379]

Grab the Windows version here.

https://github.com/MSOpenTech/redis/releases

Extract to a desktop folder or wherever and run redis-server.exe then you are good to go. Your machine will accept connections from your laravel application. Took me a while to understand what was going on!

6 likes
venkatesh's avatar

I know this is very late reply but this will be use full to others. Redis Installation and Usage Procedure. 1.Add this package in your composer.json file "predis/predis" : "~1.0" 2.composer update 3.Type in your terminal: redis-cli if if says some error. 4.sudo apt-get install redis-tools 5.sudo apt-get install redis-server 6.type redis-cli then it will display like this 127.0.0.1:6379> 7.Set password using the following command 127.0.0.1:6379>CONFIG SET requirepass "mypass" OK 127.0.0.1:6379>AUTH mypass OK

Then The Redis server is working properly.

2 likes

Please or to participate in this conversation.