title: How can I extract or uncompress gzip file using php?
body: <pre><code>function uncompress($srcName, $dstName) {
      $sfp = gzopen($srcName, "rb");
      $fp = fopen($dstName, "w");
  
      while ($string = gzread($sfp, 4096)) {
          fwrite($fp, $string, strlen($string));
      }
      gzclose($sfp);
      fclose($fp);
  }
  </code></pre>
  
  <p>I tried this code but this does not work, I get:</p>
  
  <blockquote>
    <p><strong>Internal Server Error</strong><br>
    The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@domain.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log.<br>
    <em>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.</em></p>
  </blockquote>