Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 15521

In PhpRedisConnector.php line 161 Connection refused redis laravel

$
0
0

I need help setting up Redis correctly in Laravel. I've already tried what I found on the internet, but I'm not sure if I'm missing a step. I'm getting the following error:

In PhpRedisConnector.php line 161:  Connection refused

I installed the Redis extension for PHP, I think i can confirm it with this:

php-extension

Then I installed Docker and Redis, and I received the PONG from the PING.

pong

Also, I have restarted FPM With

sudo systemctl restart php8.1-fpm.service

After that, I cleared the Laravel cache.

clear-cache

And I configured the .env with the following.

env content

And i try to execute this artisan command and i get the error:

<?phpnamespace App\Console\Commands;use Illuminate\Console\Command;use Illuminate\Support\Facades\Redis;class TestRedisCommand extends Command{    /**     * The name and signature of the console command.     *     * @var string     */    protected $signature = 'custom:test_redis';    /**     * The console command description.     *     * @var string     */    protected $description = 'Command description';    /**     * Execute the console command.     *     * @return int     */    public function handle()    {        $redis = Redis::connection();        if ($redis->ping()) {            echo "Conexión Exitosa";        }        return Command::SUCCESS;    }}

Please, is there something I'm missing? I don't see where the error could be.


Viewing all articles
Browse latest Browse all 15521

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>