惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
Netflix TechBlog - Medium
雷峰网
雷峰网
The Cloudflare Blog
博客园 - 叶小钗
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
美团技术团队
J
Java Code Geeks
S
SegmentFault 最新的问题
罗磊的独立博客
WordPress大学
WordPress大学
大猫的无限游戏
大猫的无限游戏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
腾讯CDC
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 司徒正美
T
Tailwind CSS Blog
宝玉的分享
宝玉的分享
博客园 - 聂微东
Apple Machine Learning Research
Apple Machine Learning Research
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - Franky
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
aimingoo的专栏
aimingoo的专栏
M
MIT News - Artificial intelligence
B
Blog RSS Feed
Martin Fowler
Martin Fowler
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 【当耐特】
D
Docker
爱范儿
爱范儿
云风的 BLOG
云风的 BLOG
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Check Point Blog
博客园_首页
Vercel News
Vercel News
量子位
有赞技术团队
有赞技术团队
Google DeepMind News
Google DeepMind News
IT之家
IT之家
阮一峰的网络日志
阮一峰的网络日志
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Last Week in AI
Last Week in AI
The Register - Security
The Register - Security
G
Google Developers Blog
Hugging Face - Blog
Hugging Face - Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Redis on Windows with Laragon and Laravel: The PATH Issue That Looks Like a Redis Issue
Tahsin Abrar · 2026-06-26 · via DEV Community

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 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"