<?php
set_time_limit(0);
$hostfile = fopen("https://github.com/tommy-muehle/puppet-vagrant-boxes/releases/download/1.1.0/centos-7.0-x86_64.box", 'r');
$fh = fopen("centos-7.0-x86_64.box", 'w');
while (!feof($hostfile)) {
$output = fread($hostfile, 8192);
fwrite($fh, $output);
}
fclose($hostfile);
fclose($fh);
官方文档链接:http://php.net/manual/zh/ref.curl.php
PHP远程下载大文件方法,防止内存溢出
最新推荐文章于 2025-06-03 17:24:48 发布