2012-10-03 74 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

它沒有寫入當前目錄的權限。更改權限有所幫助。再次感謝 –