douqiong8412 2012-06-29 18:43
浏览 123
已采纳

使用php在gzopen中解压缩大型gzip文件的缓冲区大小是多少?

function uncompress($srcName, $dstName) {
    $sfp = gzopen($srcName, "rb");
    $dstName = str_replace('.gz', '', $dstName);
    $fp = fopen($dstName, "w");

        fseek($FileOpen, -4, SEEK_END);
        $buf = fread($FileOpen, 4);
        $GZFileSize = end(unpack("V", $buf));

    while ($string = gzread($sfp, $GZFileSize)) {
        fwrite($fp, $string, strlen($string));
    }
    gzclose($sfp);
    fclose($fp);
}

I use this code for uncompressing but It does not work and I get following error:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@example.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.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

  • 写回答

3条回答 默认 最新

  • doutinghou6980 2012-06-29 18:51
    关注

    This should help you see the error messages. Either it will displayed on the screen or will be printed into the txt file, although the directory must be writable by php.

    <?php //top of script
    error_reporting(E_ALL);
    ini_set('display_errors', 1);
    ini_set('log_errors', 1);
    ini_set('error_log', 'errors.txt');
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥20 iOS绕地区网络检测
  • ¥15 python验证码滑块图像识别
  • ¥15 根据背景及设计要求撰写设计报告
  • ¥15 QT6颜色选择对话框显示不完整
  • ¥20 能提供一下思路或者代码吗
  • ¥15 用twincat控制!
  • ¥15 请问一下这个运行结果是怎么来的
  • ¥15 单通道放大电路的工作原理
  • ¥30 YOLO检测微调结果p为1
  • ¥15 DS18B20内部ADC模数转换器