如何在Windows上的纯PHP中提取.tar文件? [英] How do I extract a .tar file in pure PHP on Windows?

查看:173
本文介绍了如何在Windows上的纯PHP中提取.tar文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个要在Windows上运行的PHP脚本.我需要提取一个.tar文件.如何解压缩tar文件.我知道PharData类,它可以在Linux上运行,但不能在Windows上运行.我的脚本死了,没有错误输出或任何东西.相同的代码块在Linux上运行.我在Windows上使用PHP 5.4.0

I have a PHP script that I want to run on Windows. I need to extract a .tar file. How do I extract the tar file. I know of the PharData class and that works on Linux but not on Windows. My script just dies, no error output or anything. This same block of code runs on Linux. I'm using PHP 5.4.0 on Windows

$phar_data = new PharData($out_filepath);
$phar_data->extractTo($destination_folder);

是否存在另一种提取.tar文件的纯PHP方法?

Is there an alternative pure PHP way to extract a .tar file?

edit:我应该说我的真正意图是提取一个.tar.gz文件,但是gzopen执行.gz部分.现在我需要照顾.tar部分

edit: I should say my real intent is to extract a .tar.gz file, but gzopen does the .gz part. Now I need to take care of the .tar part

推荐答案

这太难了.尝试类似的方法:

It's too hard. Try something like this: http://www.phpclasses.org/package/945-PHP-Create-tar-gzip-bzip2-zip-extract-tar-gzip-bzip2-.html

这篇关于如何在Windows上的纯PHP中提取.tar文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆