2012-10-03 59 views
0

我刚刚下载并在本地服务器上安装了PHPExcel框架,按照此处的安装过程。 https://github.com/PHPOffice/PHPExcel/blob/develop/install.txtPHPExcel错误 - 运行示例

但在运行样本测试http://localhost/Tests/02types.php不断给我这个错误:

08:10:37 Create new PHPExcel object 
08:10:37 Set document properties 
08:10:37 Set default font 
08:10:37 Add some data 
08:10:37 Rename worksheet 
08:10:37 Write to Excel2007 format 
Fatal error: Uncaught exception 'Exception' with message 'Could not close zip file /var/www/Tests/02types.xlsx.' in /var/www/Classes/PHPExcel/Writer/Excel2007.php:378 Stack trace: #0 /var/www/Tests/02types.php(124): PHPExcel_Writer_Excel2007->save('/var/www/Tests/...') #1 {main} thrown in /var/www/Classes/PHPExcel/Writer/Excel2007.php on line 378 

有谁知道为什么会发生? 任何帮助将被apprciated。

海伦

回答

0

如果zip文件无法关闭,那么就意味着两件事情之一:

要么

You have any existing zip file open in another application

Your PHP doesn't have the relevant permissions to write to the directory where it's trying to create the zip file

+0

感谢您的重播 - 将研究它,并让你知道,如果我设法得到它的工作。但是,我确定我没有打开任何现有的zip文件。 –

+0

它没有写入当前目录的权限。更改权限有所帮助。再次感谢 –