【问题标题】:PHPExcel Writter Excel2007PHPExcel 编写器 Excel2007
【发布时间】:2011-07-21 07:55:17
【问题描述】:

我正在使用 PHPExcel 库生成 mysql 数据库表的 excel 文件。但是当我调用一个生成 excel 的函数时,我遇到了一个致命错误。下面给出了即将出现的错误。

致命错误:未捕获的异常“异常” 带有消息“无法关闭 zip 文件 DfEeFxMeVtUnSbKoEpTpYdYiYsEnGrQi.xlsx。” 在 /home/testcente2/domains/topcats-backend-testcenter.nl/public_html/dev/core/lib/PHPExcel/Writer/Excel2007.php:337 堆栈跟踪: #0 /home/testcente2/domains/topcats-backend-testcenter.nl/public_html/dev/core/lib/class.IExportModule.php(81): PHPExcel_Writer_Excel2007->save('DfEeFxMeVtUnSbK...') #1 /home/testcente2/domains/topcats-backend-testcenter.nl/public_html/dev/core/lib/class.ExportModule_lang.php(59): IExportModule->_download_Excel2007() #2 /home/testcente2/domains/topcats-backend-testcenter.nl/public_html/dev/controllers/export.get.create.php(12): ExportModule_lang->export() #3 /home/testcente2/domains/topcats-backend-testcenter.nl/public_html/dev/export.php(17): require_once('/home/testcente...') #4 {main} 在第 337 行抛出 /home/testcente2/domains/topcats-backend-testcenter.nl/public_html/dev/core/lib/PHPExcel/Writer/Excel2007.php

你好朋友请告诉我为什么会出现这个错误,我们该如何解决这个错误?

【问题讨论】:

  • 你能发布一些代码吗?在我看来,您遇到了一些问题,例如文件被压缩的文件夹的访问权限不正确。
  • 使用phpinfo(); 并查看zlib 是否启用??

标签: php


【解决方案1】:

来自PHPEXCEL Reference

要求

  • PHP 5.2.0 或更高版本
  • 启用 PHP 扩展 php_zip **
  • 启用 PHP 扩展 php_xml
  • 启用 PHP 扩展 php_gd2(如果未编译)

http://www.php.net/downloads.php 上的 PHP 包 (zip) 的所有部分,应在php.ini 中启用

** php_zip 只有 PHPExcel_Reader_Excel2007 需要, PHPExcel_Writer_Excel2007、PHPExcel_Reader_OOCalc。换句话说,如果 您需要 PHPExcel 来处理 .xlsx 或 .ods 文件,您将需要 zip 扩展名,否则不会。

【讨论】:

  • @Brijesh..这是您想要的答案还是不同的答案??
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-08-16
  • 2018-11-28
  • 2011-07-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多