Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
••••
KI & AI VideosJulian Goldie SEO: Jev AI Just Changed SEO Forever(29.09.2026 um 08:00 Uhr)
••••
Sichere ProgrammierungDurable AI Agents: Workflow Strategies for Resilient Systems(29.09.2026 um 07:29 Uhr)
•
Sichere ProgrammierungWhat If Your AI Agent Never Had to Leave the Browser?(29.09.2026 um 07:30 Uhr)
•••••
KI & AI VideosJulian Goldie SEO: Jev AI Just Changed SEO Forever(29.09.2026 um 08:00 Uhr)
••••
Sichere ProgrammierungDurable AI Agents: Workflow Strategies for Resilient Systems(29.09.2026 um 07:29 Uhr)
•
Sichere ProgrammierungWhat If Your AI Agent Never Had to Leave the Browser?(29.09.2026 um 07:30 Uhr)
•
Intelligence View
⚡ tsecurity.de Intelligence

Redis on Windows with Laragon and Laravel: The PATH Issue That Looks Like a Redis Issue

A few days ago, I was working on a Laravel project on Windows. The project needed Redis for cache and queue handling, and since I was using Laragon, I thought the setup would be simple. Laragon already had Redis inside its bin folder. I…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

A few days ago, I was working on a Laravel project on Windows. The project needed Redis for cache and queue handling, and since I was using Laragon, I thought the setup would be simple.



Diagram



Laragon already had Redis inside its bin folder. I started Redis, opened the terminal, and ran:




redis-cli ping






It returned:




PONG






Perfect.



Then I moved to my Laravel project folder, opened Git Bash, and tried the same command again.




redis-cli ping






This time, I got:




bash: redis-cli: command not found






At first, it looked like Redis was not installed properly. Then I wondered if Redis only worked inside Laragon’s www folder. Maybe my Laravel project was outside the correct directory?



But the real problem was much simpler.



It was not a Redis problem.



It was not a Laravel problem.



It was not a project folder problem.



It was a PATH problem.



In this post, I’ll walk through the full Redis setup on Windows using Laragon, how to make redis-cli work from Git Bash, and how to connect it properly with a Laravel project.









The Real Situation



My Laravel project was not inside Laragon’s default www folder. It was somewhere like this:




C:\Users\Asus\Downloads\aromablendbd






But Laragon was installed here:




D:\C-data\laragon






When I opened Laragon’s own terminal or Cmder, this worked:




redis-cli ping






Output:




PONG






But inside Git Bash from my Laravel project folder, the same command failed:




bash: redis-cli: command not found






This is where the confusion started.



Redis itself does not care where your Laravel project is located. Redis runs as a server, usually on:




127.0.0.1:6379






So any project can connect to it, whether the project is inside www, Downloads, Desktop, or another drive.



The only issue was that Git Bash did not know where redis-cli.exe was located.



Laragon’s terminal automatically adds Laragon tools to its PATH. Git Bash does not.









Step 1: Find the Redis CLI File



First, we need to find the actual redis-cli.exe file inside Laragon.



In Git Bash, run:




find /d/C-data/laragon/bin -iname "redis-cli.exe"






Your Laragon path may be different. For example, if Laragon is installed in C:\laragon, you may need:




find /c/laragon/bin -iname "redis-cli.exe"






In my case, the result was:




/d/C-data/laragon/bin/redis/redis-x64-5.0.14.1/redis-cli.exe






This confirmed that Redis CLI was already installed. Git Bash simply could not find it globally.









Step 2: Test Redis Using the Full Path



Before changing PATH settings, it’s always good to test the command directly.



I ran:




/d/C-data/laragon/bin/redis/redis-x64-5.0.14.1/redis-cli.exe ping






And the output was:




PONG






That was the important moment.



It confirmed three things:



Redis was installed.



Redis server was running.



Git Bash could reach Redis when I used the full path.



So the server was fine. The port was fine. The Laravel folder location was fine.



Only the command shortcut was missing.









Step 3: Add Redis CLI to Git Bash PATH



To make redis-cli available from any folder in Git Bash, I added the Redis folder to ~/.bashrc.



Here is the command I used:




echo 'export PATH="$PATH:/d/C-data/laragon/bin/redis/redis-x64-5.0.14.1"' >> ~/.bashrc
source ~/.bashrc






After that, I tested again:




redis-cli ping






This time, it worked:




PONG






Now I could run redis-cli from any folder, including my Laravel project folder.



This is the clean fix for the redis-cli: command not found issue in Git Bash.









A Small Redis CLI Mistake That Can Confuse You



At one point, I entered the Redis shell by running:




redis-cli






Then the terminal changed to something like this:




127.0.0.1:6379>






Inside this prompt, I tried:




redis-cli ping






That was wrong.



When you are inside the Redis shell, you should only write Redis commands.



Correct:




ping






Output:




PONG






Wrong:




redis-cli ping






Why?



Because redis-cli is a terminal command. It starts the Redis command-line tool.



But once you are already inside Redis CLI, you only need to type Redis commands like:




ping
set name laragon
get name
exit






So there are two valid ways to test Redis.



From the normal terminal:




redis-cli ping






Or from inside the Redis shell:




redis-cli






Then:




ping






Both are correct, but they are used in different places.









Step 4: Make Sure Redis Server Is Running



If you installed the full version of Laragon, Redis is usually included inside the Laragon bin directory.



A common Redis path looks like this:




C:\laragon\bin\redis\redis-x64-3.2.100






Or in my case:




D:\C-data\laragon\bin\redis\redis-x64-5.0.14.1






You can start Redis by running:




redis-server.exe






Or from Git Bash, using the full path:




/d/C-data/laragon/bin/redis/redis-x64-5.0.14.1/redis-server.exe






Once the Redis server is running, keep that terminal open.



To stop the server later, press:




Ctrl + C






Laragon may also let you manage Redis from its menu depending on your installation.



One important note: Redis native Windows support is limited, and many Windows setups use older Redis builds. For the latest Redis versions, Docker, WSL, or Laradock can be a better option. But for local Laravel development, Laragon’s Redis works well enough in many cases.









Step 5: Configure Laravel .env



After Redis worked in the terminal, the next step was Laravel.



In the Laravel project, I opened the .env file and checked the Redis settings.



For my setup, I used:




REDIS_CLIENT=predis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379






If you want to use Redis for cache, also check your cache setting.



For newer Laravel versions:




CACHE_STORE=redis






For older Laravel versions:




CACHE_DRIVER=redis






The key point is this:



Laravel does not need the redis-cli command to connect to Redis.



Laravel connects to Redis through PHP using the host and port:




127.0.0.1:6379






So even if redis-cli was not available in Git Bash, Laravel could still connect if the Redis client package or PHP extension was correctly installed.









Step 6: Install Laravel Dependencies



If this is an existing Laravel project, run:




composer install






This installs the dependencies listed in composer.json.



In my case, Laravel was configured to use Predis:




REDIS_CLIENT=predis






But when I tested Redis in Laravel, I got this error:




Class "Predis\Client" not found






That means Laravel wanted to use Predis, but the package was not installed.



The fix was simple:




composer require predis/predis






After installing Predis, I cleared Laravel’s cached config:




php artisan config:clear
php artisan cache:clear
php artisan optimize:clear






This step is important because Laravel may keep old .env or config values in cache.









Predis vs PhpRedis



Laravel can use Redis in two common ways.



The first option is Predis.




REDIS_CLIENT=predis






For this, install the Composer package:




composer require predis/predis






This is often the easiest option when you are working on Windows and want a quick local setup.



The second option is PhpRedis.




REDIS_CLIENT=phpredis






For this, you need the PHP Redis extension enabled.



In Laragon, the Redis PHP extension does not always come enabled by default. You may need to download the correct php_redis.dll file that matches your PHP version, architecture, and thread-safety build.



You can check your PHP version from Laragon. Then download the matching Redis extension DLL from PECL:




https://pecl.php.net/package/redis






After downloading, copy:




php_redis.dll






Into your PHP extension folder, for example:




C:\laragon\bin\php\php-8.x.x\ext






Then add this line to your php.ini file:




extension=php_redis.dll






Restart Laragon after making the change.



For many local projects, Predis is simpler. For better performance in some production setups, PhpRedis is commonly used.









Step 7: Test Redis from Laravel Tinker



Now came the final test.



From the Laravel project folder, I ran:




php artisan optimize:clear
php artisan tinker






Inside Tinker, I first tried:




Redis::connection()->ping();






But I got:




Class "Redis" not found






This does not always mean Redis is broken. It can simply mean the Redis facade was not imported in Tinker.



The safer way is to use the full namespace:




\Illuminate\Support\Facades\Redis::connection()->ping();






Or use Laravel’s service container:




app('redis')->connection()->ping();






Expected output:




"PONG"






When I saw "PONG" from Laravel Tinker, the setup was finally complete.



At that point, Redis was working in three places:



From Laragon terminal.



From Git Bash.



From Laravel itself.









Common Errors and What They Really Mean






bash: redis-cli: command not found



This means your terminal cannot find redis-cli.exe.



It does not mean Redis is not installed.



Fix it by adding the Redis folder to Git Bash PATH:




echo 'export PATH="$PATH:/d/C-data/laragon/bin/redis/redis-x64-5.0.14.1"' >> ~/.bashrc
source ~/.bashrc






Then test:




redis-cli ping












Class "Predis\Client" not found



This means Laravel is using Predis, but the package is missing.



Fix:




composer require predis/predis
php artisan optimize:clear












Class "Redis" not found



This may happen in Tinker when the Redis facade is not imported.



Use the full namespace:




\Illuminate\Support\Facades\Redis::connection()->ping();






Or:




app('redis')->connection()->ping();












Redis Works in www but Not in Another Folder



This is usually not a folder issue.



Laragon terminal automatically sets PATH for Laragon tools. Git Bash does not.



Redis runs on:




127.0.0.1:6379






So your Laravel project can be anywhere as long as Redis is running and Laravel is configured correctly.









Final Working Setup



Here is the final setup that worked for me.



Redis CLI path:




/d/C-data/laragon/bin/redis/redis-x64-5.0.14.1/redis-cli.exe






Git Bash PATH fix:




echo 'export PATH="$PATH:/d/C-data/laragon/bin/redis/redis-x64-5.0.14.1"' >> ~/.bashrc
source ~/.bashrc






Redis terminal test:




redis-cli ping






Expected:




PONG






Laravel .env:




REDIS_CLIENT=predis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
CACHE_STORE=redis






Install Predis:




composer require predis/predis






Clear Laravel config:




php artisan config:clear
php artisan cache:clear
php artisan optimize:clear






Test in Tinker:




php artisan tinker






Then:




\Illuminate\Support\Facades\Redis::connection()->ping();






Expected:




"PONG"


2. Cyber Threat Intelligence & Forensik

IoC Intelligence (1 Indikatoren)
5[.]0[.]14[.]1
CTI Threat Relationship Graph2 Knoten / 1 Relationen
CVE / Incident Software MITRE ATT&CK CWE Weakness IoC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Redis on Windows with Laragon and Laravel: The PATH Issue That Looks Like a Redis Issue

Thematisch verwandte Begriffe: Redis, Windows, with, Laragon · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-101281 | A flaw has been found in Trusted Domain Project OpenDMARC up to 1.4.2. …
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag