PHPExcel例外:“无法关闭zip文件..." [英] PHPExcel exception: "Could not close zip file ... "

查看:128
本文介绍了PHPExcel例外:“无法关闭zip文件..."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Mac的XAMPP进行本地开发,但是我在工作中使用了此代码(使用Windows和其他相同的开发环境),并且运行良好:

I am using XAMPP a Mac for local development, but I used this code at work (using Windows and an otherwise identical development environment) and it worked fine:

$objPHPExcel = new PHPExcel();
$sheet       = $objPHPExcel->createSheet();
$sheet->fromArray($a);
...
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
//$objWriter->save('P:/Projects/Mess3/Sadness.xlsx');
$objWriter->save('/Users/tjb1982/Desktop/sadness.xlsx');

注释掉的文本可在我的Windows系统上使用.我试图将文件输出到'php://output'并弄得乱七八糟(这是所期望的吗?).

The commented-out text works with my Windows system at work. I tried to output the file to 'php://output' and got a garbled mess (is that what is to be expected?).

我似乎找不到其他遇到此问题的人,而那些遇到权限问题或在尝试保存文件时打开了文件的人除外.请帮忙!

I can't seem to find anyone who is experiencing this problem outside of those who had permissions problems or had the file open when they were trying to save it. Please help!

推荐答案

我遇到了同样的错误无法关闭zip文件..",并且意识到它没有写该目录的权限.检查您的写入权限. (IIS8 + php + mysql + oracle)

I was getting the same error "Cannot close zip file.." and realized it didn't have permissions to write to that directory. Check your write permissions. (IIS8 + php + mysql + oracle)

一旦我允许了写权限,问题将立即得到解决.

Once i allowed write permissions problem was immediately fixed.

这篇关于PHPExcel例外:“无法关闭zip文件..."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆