通过php代码去弄 总是会被序列化127.0.0.1:6379> ZRANGE key 0 -1 WITHSCORES1) "i:1;"
2) "1"
3) "s:6:\"google\";"
4) "1"
5) "i:4;"
6) "2"
7) "s:4:\"i:1;\";"
8) "2"
127.0.0.1:6379> ZRANGE key 0 -1 WITHSCORES但是 我在cli下 可以直接添加正常. 这是为什么?127.0.0.1:6379> zadd key 1 google(integer) 1
127.0.0.1:6379> ZRANGE key 0 -1 WITHSCORES
1) "google"
2) "1"
3) "i:1;"
4) "1"
5) "s:6:\"google\";"
6) "1"
7) "i:4;"
8) "2"
9) "s:4:\"i:1;\";"
10) "2"
127.0.0.1:6379>
1 回答
RISEBY
TA贡献1856条经验 获得超5个赞
找到问题了 这样就解决了 关闭序列化
$redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_NONE); // don't serialize data$redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP); // use built-in serialize/unserialize$redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_IGBINARY); // use igBinary serialize/unserialize$redis->setOption(Redis::OPT_PREFIX, 'myAppName:'); // use custom prefix on all keys
- 1 回答
- 0 关注
- 659 浏览
添加回答
举报
0/150
提交
取消