PHP8.1.21版本已发布
vue8.1.21版本已发布
jquery8.1.21版本已发布

phpredis模块安装好了,new redis不起作用

原创
2016-06-06 20:16:36 911浏览

connect('localhost', 6379);
   echo "Connection to server sucessfully";
   //check whether server is running or not
   echo "Server is running: "+ $redis->ping();
?>

上面是我的代码和运行后的截图,我不明白是什么原因导致的,拜托各位指点指点了。

回复内容:

connect('localhost', 6379);
   echo "Connection to server sucessfully";
   //check whether server is running or not
   echo "Server is running: "+ $redis->ping();
?>

上面是我的代码和运行后的截图,我不明白是什么原因导致的,拜托各位指点指点了。

你打印一下$redis->connect()的返回值,看看是不是真的连上了,
如果连上了,就set一个值,在redis-cli里面查看有没有真的设置上。

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。