How do I extract a .tar file in pure PHP on Windows?

十年热恋 提交于 2019-12-11 10:09:49

问题


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);

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

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


回答1:


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



来源:https://stackoverflow.com/questions/13870800/how-do-i-extract-a-tar-file-in-pure-php-on-windows

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!