php redis Uncaught exception 'RedisException' with message 'Redis server went a解決方案
來源:互聯網
上載者:User
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都不好用,真不知道是哪裡出問題了,請高手指點
------解決思路----------------------
商刻的未來就看你了