Build Tar file from directory in PHP without exec/passthru
So I have a client who's current host does not allow me to use tar via exec()/passthru()/ect and I need to backup the site periodicly and programmaticly so is there a solution? This is a linux server. PHP 5.3 offers a much easier way to solve this issue. Look here: http://www.php.net/manual/en/phardata.buildfromdirectory.php <?php $phar = new PharData('project.tar'); // add all files in the project $phar->buildFromDirectory(dirname(__FILE__) . '/project'); ?> At http://pear.php.net/package/Archive_Tar you can donload the PEAR tar package and use it like this to create the archive: <?php