title: Why PHP's gzuncompress() function can go wrong?
body: <p>PHP has its own function to work with gzip archives. I wrote the following code:</p>
  
  <pre><code>error_reporting(E_ALL);
  $f = file_get_contents('http://spiderbites.nytimes.com/sitemaps/www.nytimes.com/sitemap.xml.gz');
  echo $f;
  $f = gzuncompress($f);
  echo "&lt;hr&gt;";
  echo $f;
  </code></pre>
  
  <p>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.</p>
  
  <p>However gzuncompress thrown <code>Warning: gzuncompress(): data error in /home/path/to/script.php on line 5</code></p>
  
  <p>Can anyone point me to the right direction to solve this problem?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The part of phpinfo() output</p>
  
  <p><img src="https://i.stack.imgur.com/ujdNB.png" alt="enter image description here"></p>