php redis Uncaught exception 'RedisException' with message 'Redis server went a
程序员文章站
2022-05-26 07:58:32
...
php代码:
ini_set('default_socket_timeout', -1);
$redis = new Redis();
$redis->connect("192.168.2.156","6379"); //php客户端设置的ip及端口
$redis->auth('123456');
//$redis->select(1);
$redis->set("say","Hello World");
$data = $redis->get("say"); //应输出Hello World
var_dump($data);
提示错误:Fatal error: Uncaught exception 'RedisException' with message 'Redis server went away' in /usr/local/nginx/html/index.php:56 Stack trace: #0 /usr/local/nginx/html/index.php(56): Redis->auth('123456') #1 {main} thrown in /usr/local/nginx/html/index.php on line 56
redis服务打开了,防火墙也给关闭了,phpinfo里也看到了php的redis扩展,selinux不管设置成disabled还是permissive都不好用,真不知道是哪里出问题了,请高手指点
说的很对,你的回答我很满意!!!
ini_set('default_socket_timeout', -1);
$redis = new Redis();
$redis->connect("192.168.2.156","6379"); //php客户端设置的ip及端口
$redis->auth('123456');
//$redis->select(1);
$redis->set("say","Hello World");
$data = $redis->get("say"); //应输出Hello World
var_dump($data);
提示错误:Fatal error: Uncaught exception 'RedisException' with message 'Redis server went away' in /usr/local/nginx/html/index.php:56 Stack trace: #0 /usr/local/nginx/html/index.php(56): Redis->auth('123456') #1 {main} thrown in /usr/local/nginx/html/index.php on line 56
redis服务打开了,防火墙也给关闭了,phpinfo里也看到了php的redis扩展,selinux不管设置成disabled还是permissive都不好用,真不知道是哪里出问题了,请高手指点
回复讨论(解决方案)
问题解决啦,来人送分结贴啦!
商刻的未来就看你了
商刻的未来就看你了
说的很对,你的回答我很满意!!!
上一篇: 请问一个XML有关问题
推荐阅读
-
php redis Uncaught exception 'RedisException' with message 'Redis server went a解决方案
-
php redis Uncaught exception 'RedisException' with message 'Redis server went a
-
php redis Uncaught exception 'RedisException' with message 'Redis server went a
-
phpredis - php连接redis报错Redis server went away
-
Redis 多进程Uncaught exception 'RedisException' with message
-
Redis 多进程Uncaught exception 'RedisException' with message