0

Is it possible to untar a file in a remote server with php, and without using exec or passthru? I normally do thissshwith bash, in assh` console, but I wonder if it is possible to do it with php.

So far, I managed to copy the file using an ftp connection, but I can't find the way to use the tar command in the remote server. Any ideas on how to do it?

Charles
  • 50,943
  • 13
  • 104
  • 142
open-ecommerce.org
  • 1,763
  • 1
  • 25
  • 41
  • Found [this library](http://pear.php.net/package/Archive_Tar) using [this search](https://duckduckgo.com/?q=php+tar). In fact, [this one](http://stackoverflow.com/questions/4878792/how-can-i-read-a-tar-gz-file-with-php) looks better. – halfer Dec 19 '13 at 14:32
  • Sorry halfer but this answer didn't answer my question. This post shows how to untar a file if you are in the same server. What i need it is to untar the file from another server – open-ecommerce.org Dec 20 '13 at 08:02

1 Answers1

0

have had a look here ?

PHP Untar-gz without exec()?

if i have understood well this could solve your problem :D

Community
  • 1
  • 1
Aliceiw
  • 420
  • 5
  • 19
  • If you believe this is a duplicate question, a comment is generally better `:)`. – halfer Dec 19 '13 at 14:34
  • actually i didn't know what to do ^^''' just a comment and then the moderator will mark as duplicated if it's true? – Aliceiw Dec 19 '13 at 14:43
  • The link you are referring works only in the same server you running your php script – open-ecommerce.org Dec 19 '13 at 17:09
  • 1
    @open: do you mean the link on this answer, or on the dup indicated on the question? You can always retrieve a remote file using `file_get_contents` and then do an operation on it locally. – halfer Dec 19 '13 at 20:18