【发布时间】:2016-07-11 20:40:54
【问题描述】:
我根本无法让 ZipArchive 在 windows 下正常工作。
这段代码
$returnValue = $zipArchive->open(sprintf('%s.zip',$case->getId()), \ZipArchive::CREATE);
if (!is_resource($returnValue)){
exit("".$returnValue." ".sprintf('%s.zip',$case->getId()));
}
foreach($case->getFiles() as $file){
$filePath = $cacheFileManager->getPathPrefix().$file->getLocation();
if(file_exists($filePath)){
$zipArchive->addFile($folderPath, basename($file->getName()));
}else{
exit($filePath);
}
}
$zipArchive->close();
调用open函数后的返回值为
“1 d08efeaa-2819-11e6-ba08-2c56dc4a62f3.zip”
所以我猜由于某种原因会发生此错误“不支持多磁盘 zip 存档”。
我不知道我做了一些设置或更改。
还是说 ZipArchive 在 Windows 下不可用?我正在使用 PHP 7。
感谢您的建议
【问题讨论】:
标签: php windows php-7 ziparchive