★ wanayoo — archive 1999 https://github.com/phpredis/phpredis/issues/387Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re Issue#153 zRevRange/zRange raise PHP Warning "igbinary_unserialize_header" #387

Closed
larest opened this issue Oct 10, 2013 · 6 comments
Closed

Comments

@larest
Copy link

@larest larest commented Oct 10, 2013

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
@moazzamk
Copy link

@moazzamk moazzamk commented Dec 15, 2015

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?

@michael-grunder
Copy link
Member

@michael-grunder michael-grunder commented Dec 16, 2015

This was a long time ago but I thought I fixed it. I'll try again on latest develop.

@moazzamk
Copy link

@moazzamk moazzamk commented Dec 16, 2015

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.

@michael-grunder
Copy link
Member

@michael-grunder michael-grunder commented Dec 16, 2015

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 😺

@moazzamk
Copy link

@moazzamk moazzamk commented Dec 18, 2015

Hey, did you get a chance to check on this?

@michael-grunder
Copy link
Member

@michael-grunder michael-grunder commented Dec 18, 2015

Hey,

I just ran a test against develop and it works fine:

➜ phpredis git:(develop) ✗ php55 ltests/igencode.php <br>No troubles<br> Array ( [A] => 9996 [B] => 9997 [C] => 9998 [D] => 9999 ) <br>Troubles begin from 10000<br>Array ( [A] => 9999 [B] => 10000 [C] => 30000 [D] => 40000 )

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.