php redis Uncaught exception 'RedisException' with message 'Redis server went a解决方案

WBOY
Release: 2016-06-13 12:16:42
Original
1558 people have browsed it

php redis Uncaught exception 'RedisException' with message 'Redis server went a
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都不好用,真不知道是哪里出问题了,请高手指点
------解决思路----------------------
商刻的未来就看你了

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template