Hi, I need to run an exec("gunzip") to decompress some files that are on a .tar.gz file on the server. Someone told me I should use this code :
<?php
exec('gzip file.tar.gz');
?>
But it doesnt work. Can you help ? Thanks.
define "doesn't work"
Sounds like you should be using something like:
passthu("tar -xvzf file.tar.gz");
Make sure tar actually exists on your system - we've already had one guy trying to do this on a mac without tar installed.
Nice, it now works, but to everyone that would be interrested in doing this, don't forget the 'r' of 'passthru'. Make this :
Yeah, my mistake - the command is passthru() not passthu()
http://www.php.net/manual/en/function.passthru.php