使用 PHP gzipp 在服务器上保存 gzip 压缩的 html 文件
我使用此脚本自动将 PHP 文件保存到服务器上的 HTML 文件中:
<?php
$page=file_get_contents('http://yourdomain.com/index.php');
$fp=fopen('index.html','w+');
fputs($fp,$page);
fclose($fp);
?>
How can I get the server to save a Gzipped version of index.php on the server?
目标是在文件夹中包含以下文件:
turn-indexphp-into-indexhtml-and-indexgz.php
index.php php
index.html
index.gz
I use this script to automatically save a PHP-file into a HTML file on my server:
<?php
$page=file_get_contents('http://yourdomain.com/index.php');
$fp=fopen('index.html','w+');
fputs($fp,$page);
fclose($fp);
?>
How can I get the server to also save a Gzipped version of index.php on the server?
The goal is to have the following files in the folder:
turn-indexphp-into-indexhtml-and-indexgz.php
index.php
index.html
index.gz
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您只能通过 URL 访问该页面(即它不是您自己服务器上的文件),正如一些评论者指出的那样 - 您将只能访问 PHP/ASP/任何文件的输出。
如果它不是本地文件
如果它是本地文件,那么你可以执行上述操作,而且...
If you can only access the page by URL (ie. it is not a file on your own server), as pointed out by a few commenters - you will only be able to access the output of the PHP/ASP/Whatever file.
If it is not a Local File
If it is a local file, then you can do the above, but also...