Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/244.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP创建Tar文件:PharData[PharException]”;无法写入文件内容,查找失败“;_Php_Tar_Phar - Fatal编程技术网

PHP创建Tar文件:PharData[PharException]”;无法写入文件内容,查找失败“;

PHP创建Tar文件:PharData[PharException]”;无法写入文件内容,查找失败“;,php,tar,phar,Php,Tar,Phar,我试图用PHP创建一个tar文件,但遇到了一些问题 使用类数据,::addFile和::buildFromDirectory都会引发相同的异常: 异常“PharException”,消息为“基于tar的phar” “C:/Apache24/htdocs/_frames/storage/glacier/archive_cache/9.tar” 无法创建,无法删除文件“MVI_4492.MOV”的内容 已写入,搜索失败 C:/Apache24/htdocs/_frames/storage/glaci

我试图用PHP创建一个tar文件,但遇到了一些问题

使用类数据,
::addFile
::buildFromDirectory
都会引发相同的异常:

异常“PharException”,消息为“基于tar的phar” “C:/Apache24/htdocs/_frames/storage/glacier/archive_cache/9.tar” 无法创建,无法删除文件“MVI_4492.MOV”的内容 已写入,搜索失败 C:/Apache24/htdocs/_frames/storage/glacier/cron/upload_archives.php:212 堆栈跟踪:#0 C:/Apache24/htdocs/_frames/storage/glacier/cron/upload_archives.php(212): PharData->addFile('C://Apache24//htd…','MVI_4492.MOV')#1{main}


想法?

在操作过程中,磁盘空间不足。在它之后-空间被恢复(因为tmp文件被数据填充,然后被清理)


如果不是,那么另一个原因是您使用的是32位php,它不支持大于2GB的文件。tmp空间不足。如果您对如何不耗尽tmp空间有任何想法,那就太好了。不要使用PharData类…替代方案?使用原始tar(.exe),并通过php exec()从操作系统运行它。没有tmp文件问题,它的运行速度大约快8倍!(在我的电脑上)在Windows服务器和CentOS服务器上都尝试过。小于10GB的文件可以正常工作,但大于10GB的文件会耗尽空间并出现故障。文件大小为200GB+。我刚刚在Windows 7、gnu4win版本的tar上进行了测试,20GB的tar文件创建时没有任何问题。。。