I've managed to run redis-server and redis-cli with unix socket.

But when I launch app, I got “Redis server went away”.

Configuration

redis:
    host: "/path/to/redis.sock"
    journal: on
    session: on

Break points

First collapse is on $this->driver->select($this->database); git.

Second is caused by calling $this->driver->info().


Everything is fine for TCP connection

redis:
    host: 127.0.0.1
    port: 6379

and direct Redis class use

$redis = new Redis();
$redis->connect('/path/to/redis.sock');
$redis->select(0);
$redis->info();

// ...

Where could be mistake? Maybe some access rights?

Interesting, this is my localhost redis config

daemonize yes

pidfile /var/run/redis/redis-server.pid

# port 6379
bind 127.0.0.1

unixsocket /var/run/redis/redis-server.sock
unixsocketperm 777

timeout 0
loglevel debug
databases 16
dir /var/lib/redis
lua-time-limit 5000

and this is how I connect in app on localhost

redis:
    host: /var/run/redis/redis-server.sock
    database: 0
    journal: on
    storage: on
    session: {database: 1, native: off}
    debugger: on

And it works ok.

Great, I've changed:

pidfile
unixsocket
dir

and it works. Thanks for sharing.

I had same exception, solved by setting unixsocketperm to 777 instead of defaul 700 (or whatever)

Ahoj, přeinstaloval jsem server a znovu se snažím spustit redis, bohužel mi to stále píše: “Redis server went away”, tento návod nepomohl, máte ještě nějaké jiné řešení?

Děkuji


You must first log in to participate in this discussion