Php Gzuncompress Data Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or gzdecode(): data error posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss
Gzuncompress Online
Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only php decompress gzip takes a minute: Sign up Why PHP's gzuncompress() function can go wrong? up vote 2 down vote favorite PHP has its own function to work with gzip archives. I wrote the following code: error_reporting(E_ALL); $f = file_get_contents('http://spiderbites.nytimes.com/sitemaps/www.nytimes.com/sitemap.xml.gz'); echo $f; $f call to undefined function gzuncompress() = gzuncompress($f); echo "
"; echo $f; First echo normally outputs the compressed file with proper header (at least first two bytes are correct). If I'd download this file with my browser I can unzip it easily. However gzuncompress thrown Warning: gzuncompress(): data error in /home/path/to/script.php on line 5 Can anyone point me to the right direction to solve this problem? EDIT: The part of phpinfo() output php gzip unzip share|improve this question edited Dec 29 '14 at 16:55 asked Dec 29
Php Uncompress Gz File
'14 at 16:32 Vlada Katlinskaya 382212 You could use ob_gzhandler() to let PHP do the work for you using because the function gzuncompress() will return an error if the uncompressed data is more than 32768 times the length of the compressed input data or more than the optional parameter length. Or you can use the optional parameter to define the length. That should be an easy fix. –unixmiah Dec 29 '14 at 16:37 @unixmiah in my case size of the file is 4169 (compressed) / 88406 (uncompressed) so the ratio is far from 32768 (real ratio is about 21). –Vlada Katlinskaya Dec 29 '14 at 16:43 have you edited the php.ini and enabled the zip libraries? if you haven't do so and restart your web server after doing that to take the changes you've made. –unixmiah Dec 29 '14 at 16:47 @unixmiah I included phpinfo() screenshot to make this point clear. As I can see - everything is enabled. Right? –Vlada Katlinskaya Dec 29 '14 at 16:55 1 @VladaKatlinskaya: Look at mario's answer. –GiamPy Dec 29 '14 at 16:56 | show 1 more comment 2 Answers 2 active oldest votes up vote 4 down vote accepted Or you could just use the right decompression function, gzdecode(). share|improve this answer answered Dec 29 '14 at 16:52 mario 105k14138224 He's totally right, tested it myself. It works. –GiamPy Dec 29 '1
were looking for could not https://wordpress.org/support/topic/342988 be found. I'm sorry, it's not your fault… probably. About Blog Hosting Jobs Support Developers Get Involved Learn Showcase Plugins Themes Ideas WordCamp WordPress.TV BuddyPress bbPress WordPress.com Matt Privacy License / GPLv2 Code is Poetry.
Forums Training Enterprise Consulting Issue tracker Development Contact Support Marketplace Plugins Themes Premium features Developers Hosting http://piwik.org/faq/troubleshooting/faq_61/ About History Press Awards Testimonials Sponsors Team Blog Download Demo Search for: I get the error "Warning: gzuncompress() [function.gzuncompress]: data error" when looking at my Piwik reports. Category: Troubleshooting ×Close Feedback sent successfully Thank you for your valuable feedback. We will use it to make piwik.org data error even better. This error happens in very rare cases where, for some unknown reasons, the data was not properly recorded in the database. In Piwik, all reports data is compressed (gzip) and then stored in the tables piwik_archive_*. To fix this issue, look at the error php gzuncompress data message and search for "piwik_archive_blob". For example, if the error looks like: #0 Piwik_ErrorHandler(2, gzuncompress() [function.gzuncompress]: data error, /path/piwik/core/Archive/Single.php, 250, Array ([name] => Referers_searchEngineByKeyword,[typeValue] => blob,[table] => piwik_archive_blob_2009_05,[...] You can find "piwik_archive_blob_2009_05". Please delete this table in your Piwik database. Piwik will process it again next time you are viewing reports. This will fix the issue. Send us your feedback about this page! Thanks for contacting us! We will get in touch with you shortly. Feedback on this page Name (required) Email (required) Your feedback (required) Any questions? Many answers and more information about Piwik You can find here: User Guides Forums FAQs Support We are social Follow us: Newsletter Facebook Twitter Linkedin Github Piwik.org. © 2016 Marketplace Privacy Consulting Cloud-Hosted Piwik Developers Sponsors Support Piwik respects your privacy and gives you full control over your data.