Cache
Laravel 8
Laravel 9
Laravel 10
Laravel 11
Laravel 12
Redis Connection Refused in Laravel - How to Fix
This error occurs when Laravel cannot connect to the Redis server for caching, sessions, or queues.
The Error
Error Message
Connection refused [tcp://127.0.0.1:6379]
Common Causes
- 1 Redis server not running
- 2 Wrong Redis host or port in configuration
- 3 Redis password not set or incorrect
- 4 Firewall blocking Redis port
- 5 PHP Redis extension not installed
Solutions
1
Check if Redis is running
Bash
# Check Redis status
redis-cli ping
# Should return: PONG
# Start Redis if not running
sudo systemctl start redis
sudo systemctl enable redis
2
Configure Redis in .env
ENV
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
# If using Redis for cache/session
CACHE_DRIVER=redis
SESSION_DRIVER=redis
3
Install predis package if phpredis not available
Bash
composer require predis/predis
# Then in config/database.php set:
'client' => env('REDIS_CLIENT', 'predis'),
4
Fall back to file-based cache temporarily
ENV
# In .env while debugging Redis
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_CONNECTION=database
Need Help With Your Laravel Project?
I specialize in building custom Laravel applications, process automation, and SaaS development. Whether you need to eliminate repetitive tasks or build something from scratch, let's discuss your project.
About Hafiz
Senior Full Stack Developer. I build production software with Laravel, Filament, Vue, and AI integrations, and write about the real decisions behind shipping it.
Get in touch →