我需要在 Apache (php5.3) 上运行的 php 脚本中执行一些 tar gzip 操作。
过去,我使用过:
new PharData($archivePath . '.tar');
$p = $p->convertToExecutable(Phar::TAR, Phar::GZ);
$p->startBuffering();
但是在这种情况下,它可能必须处理1GB+ 的文件。所以我担心重载php/apache。
在那种情况下,最好依靠shell_exec
&让操作系统承担负载?