PHP Phar archive creation fails -
i'm trying create tar archive php phar. i've got 8500 files in directory , use following code:
try { $tmp_archive = tempnam(sys_get_temp_dir(), 'arc') . ".tar"; $a = new phardata($tmp_archive); $a->buildfromdirectory('/tmp/data'); $a->compress(phar::gz); unset ($a); unlink($tmp_archive); rename ($tmp_archive . ".gz", '/tmp/result.tar.gz'); } catch (exception $e) { echo "tar exception : " . $e; }
it fails during process following message:
tar exception : exception 'pharexception' message 'tar-based phar "/tmp/arcroyeoc.tar" cannot created, contents of file "3147.pdf" not written, seek failed' in /tmp/test.php:9
does know how around this? shall use command line tar instead?
Comments
Post a Comment