S
S
Samarkand2017-06-04 19:30:53
PHP
Samarkand, 2017-06-04 19:30:53

Why can't data compressed by gzcompress on the server be decompressed by gzuncompress on the local machine?

In a PHP program, the data is compressed on the server and transmitted along with the checksum to the client:
$data = base64_encode(gzcompress($str));
The client checks the checksum and if it is correct, tries to decompress the data:
$str = gzuncompress(base64_decode($data));
An error occurs:
PHP Warning: gzuncompress(): data error
The most interesting thing is that the error occurs only when certain data is compressed.
The PHP versions on the server and local computer are different, maybe the gzcompress algorithms on the server and desktop are not the same?
What can be done?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Samarkand, 2017-06-04
@Samarkand

gzcompress had nothing to do with it, my data was broken into blocks incorrectly.
Thanks to all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question