I have tried almost everything, changing lsphp versions, checking if redis is running via systemctl, making a connection test via php file from public_html .... etc.
I still cannot connect to redis regardless that everything seems to be ok on my local machine.
This is mostly the case for Shared Hosting, but not usual for VPS or dedicated server.
Default settings for VPS or dedicated server:
Port: 6379
host: localhost or 127.0.0.1
Check in CLI if Redis is running.
Code:
systemctl status redis
redis-cli KEYS '*'
redis-cli --stat