Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upRe Issue#153 zRevRange/zRange raise PHP Warning "igbinary_unserialize_header" #387
Comments
|
I face this issue too. Didn't realize it was a bug and open since 2013. Is PHPRedis not maintained anymore or did this just have a low priority? |
|
This was a long time ago but I thought I fixed it. I'll try again on latest develop. |
|
Ah, maybe. I experimented with the code again and found this: I have some Ruby code which sets a hash with HMSET. If I try to access the same hash from PhpRedis (with binary serialization), I get this error. If I set the hash in PhpRedis (with binary serialization) and then get it, then I don't see this error. I checked how the hash looks (using Redis cli) when set in Ruby or PhpRedis and it looks the same. So, I don't know what's causing this issue. If I set PhpRedis serializer to none then I can access the hash without any issues. |
|
Yeah I remember this (ages ago), it had to do with the internals of deserialization. I think it was that numbers with fewer than 5 bytes would automatically fail (and therefore work in terms of phpredis), but I know this was fixed. I'll check it in the morning and provide an update |
|
Hey, did you get a chance to check on this? |
|
Hey, I just ran a test against develop and it works fine:
This was fixed a long long time ago (I only barely remember it). You are running a really old version of phpredis, can you upgrade to 2.2.7? |
We still have PHP Warning "igbinary_unserialize_header".
Intresting that it begin if value>=10000.
Hope it help.
No troubles"; try { $redis->connect($host, $port, $timeout); } catch (Exception $e) { throw $e; } $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_IGBINARY); $redis->select($dbIndex); $redis->zAdd('TestLeaderBoard', 9996, 'A'); $redis->zAdd('TestLeaderBoard', 9997, 'B'); $redis->zAdd('TestLeaderBoard', 9998, 'C'); $redis->zAdd('TestLeaderBoard', 9999, 'D'); $result = $redis->zRevRange('TestLeaderBoard', 0, 3, true); $result = $redis->zRange('TestLeaderBoard', 0, 3, true); print_r($result); echo "
Troubles begin from 10000
"; $redis->zAdd('TestLeaderBoard', 9999, 'A'); $redis->zAdd('TestLeaderBoard', 10000, 'B'); $redis->zAdd('TestLeaderBoard', 30000, 'C'); $redis->zAdd('TestLeaderBoard', 40000, 'D'); $result = $redis->zRevRange('TestLeaderBoard', 0, 3, true); $result = $redis->zRange('TestLeaderBoard', 0, 3, true); print_r($result); ``` --- for me it show: No troubles Array ( [A] => 9996 [B] => 9997 [C] => 9998 [D] => 9999 ) Troubles begin from 10000 Warning: igbinary_unserialize_header: unsupported version: 875573296, should be 1 or 2 in /sandbox/igbinarZrevBug.php on line 34 Warning: igbinary_unserialize_header: unsupported version: 858796080, should be 1 or 2 in //sandbox/igbinarZrevBug.php on line 34 Warning: igbinary_unserialize_header: unsupported version: 825241648, should be 1 or 2 in /sandbox/igbinarZrevBug.php on line 34 Warning: igbinary_unserialize_header: unsupported version: 825241648, should be 1 or 2 in /sandbox/igbinarZrevBug.php on line 35 Warning: igbinary_unserialize_header: unsupported version: 858796080, should be 1 or 2 in /sandbox/igbinarZrevBug.php on line 35 Warning: igbinary_unserialize_header: unsupported version: 875573296, should be 1 or 2 in /sandbox/igbinarZrevBug.php on line 35 Array ( [A] => 9999 [B] => 10000 [C] => 30000 [D] => 40000 ) --- Enviroment: PHP Version 5.5.3 System Linux CentOs 2.6.32-358.18.1.el6.x86_64 #1 SMP Wed Aug 28 17:19:38 UTC 2013 x86_64 Server API FPM/FastCGI Configuration File (php.ini) Path /etc Loaded Configuration File /etc/php.ini Scan this dir for additional .ini files /etc/php.d Additional .ini files parsed /etc/php.d/igbinary.ini, /etc/php.d/redis.ini PHP API 20121113 PHP Extension 20121212 Zend Extension 220121212 Zend Extension Build API220121212,NTS PHP Extension Build API20121212,NTS Debug Build no Thread Safety disabled Zend Signal Handling disabled Zend Memory Manager enabled Zend Multibyte Support disabled IPv6 Support enabled DTrace Support enabled Registered PHP Streams https, ftps, compress.zlib, php, file, glob, data, http, ftp Registered Stream Socket Transports tcp, udp, unix, udg, ssl, sslv3, sslv2, tls Registered Stream Filters zlib._, string.rot13, string.toupper, string.tolower, string.strip_tags, convert._, consumed, dechunk igbinary igbinary support enabled igbinary version 1.1.2-dev igbinary.compact_strings On redis Redis Support enabled Redis Version 2.2.4