I am trying to ultimately extract some files from a tar archive within PHP, however my simple test script is failing at the first part, which was to simply list the files in the archive.
Is there any reason why this test script fails?
What I see output is:
> -sh-3.2$ php showfile.php /var/www/vhosts/smartphonesoft.com/httpdocs/fred/epf/itunes20100825.tbz
> tar: Old option `f' requires an
> argument. Try `tar --help' or `tar
> --usage' for more information.
My simple PHP script is:
<?php
foreach (glob("/var/www/vhosts/smartphonesoft.com/httpdocs/fred/epf/itunes*.tbz") as $file) {
}
$path_parts = pathinfo($file);
$tarfile = $path_parts['filename'];
echo $file . "\n";
exec('tar tvf $file',$ret);
?>