Gzip文件压缩

时间:2018-08-10 08:57:02

标签: php gzip

我正在尝试下载需要压缩的沉重文件。我正在使用以下php脚本,但由于我仍然收到超时错误或浏览器变得不活动,因此无法正常工作。在我的php.ini设置中启用了zlib.output_compression。还安装了gzip和deflate。任何帮助将不胜感激。

    <!doctype html public "-//w3c//dtd html 3.2//en">

<html>

<head>
<title>XML feed downloader</title>
<meta name="keywords" content="automatic redirection">
<meta http-equiv="refresh" content = "300" />
<meta name="GENERATOR" content="Arachnophilia 4.0">
<meta name="FORMATTER" content="Arachnophilia 4.0">
</head>

<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<?php
//ob_start("ob_gzhandler");
ini_set('max_execution_time', 240);
ini_set('memory_limit','-1');
ini_set('zlib.output_compression', 1);
zlib.output_compression;

$homepage = file_get_contents('http://www.example.com/getfeed/84f4800d1ea94e2d8c43241096f9ded2/getodds/soccer?cat=soccer_10');

echo "output<br>".$homepage;
ob_end_flush();
?>

</body>
</html>

0 个答案:

没有答案