【发布时间】:2018-01-12 06:07:05
【问题描述】:
我正在尝试让redis在xampp上工作,我的xampp在windows 10上是32位,php版本是5.6,我在这里下载redis
http://pecl.php.net/package/redis/2.2.7/windows(x86 线程安全的),并添加了
extension=php_redis.dll in php.ini,我用linux安装在virtualbox上的redis服务器(selinux被禁用)
这是我在 Windows 上运行的脚本
<?php
//Connecting to Redis server on localhost
$redis = new Redis();
$redis->connect('192.168.0.108', 6379);
echo "Connection to server sucessfully";
var_dump($redis);
$redis->set("say","Hello World");
echo $redis->get("say");
?>
错误显示:
Connection to server sucessfullyobject(Redis)#1 (0) { }
Fatal error: Uncaught exception 'RedisException' with message
'Redis server went away' in
D:\xampp\htdocs\test\redis\test.php:8 Stack trace: #0
D:\xampp\htdocs\test\redis\test.php(8): Redis->set('say', 'Hello World') #1 {main} thrown in
D:\xampp\htdocs\test\redis\test.php on line 8
谁知道是什么问题?我是否正确安装了扩展程序?
【问题讨论】: