PHPExcel不能在windows上工作,但在Linux上工作

问题描述:

我在OpenCart中使用了导入/导出产品的扩展,但是当我在窗口上使用它时出现错误。PHPExcel不能在windows上工作,但在Linux上工作

Fatal error: Uncaught exception 'Exception' with message 'Could not open C:\Windows\Temp\php479C.tmp for reading! File does not exist.' in C:\Inetpub\vhosts\webwhisperer.com.au\watermark\system\PHPExcel\Classes\PHPExcel\Reader\Excel2007.php:168 Stack trace: #0 C:\Inetpub\vhosts\webwhisperer.com.au\watermark\system\PHPExcel\Classes\PHPExcel\IOFactory.php(269): PHPExcel_Reader_Excel2007->canRead('C:\Windows\Temp...') #1 C:\Inetpub\vhosts\webwhisperer.com.au\watermark\system\PHPExcel\Classes\PHPExcel\IOFactory.php(207): PHPExcel_IOFactory::createReaderForFile('C:\Windows\Temp...') #2 C:\Inetpub\vhosts\webwhisperer.com.au\watermark\admin\model\catalog\productimportexport.php(1208): PHPExcel_IOFactory::identify('C:\Windows\Temp...') #3 C:\Inetpub\vhosts\webwhisperer.com.au\watermark\admin\controller\catalog\productimportexport.php(352): ModelCatalogProductImportExport->upload('C:\Windows\Temp...', '1') #4 [internal function]: ControllerCatalogProductImportExport->bulk() #5 C:\Inetpub\vhosts\webwhisperer.com.au\watermark\vqmod\ in C:\Inetpub\vhosts\webwhisperer.com.au\watermark\system\PHPExcel\Classes\PHPExcel\Reader\Excel2007.php on line 168 Fatal Error: Uncaught exception 'Exception' with message 'Could not open C:\Windows\Temp\php479C.tmp for reading! File does not exist.' in C:\Inetpub\vhosts\webwhisperer.com.au\watermark\system\PHPExcel\Classes\PHPExcel\Reader\Excel2007.php:168 Stack trace: #0 C:\Inetpub\vhosts\webwhisperer.com.au\watermark\system\PHPExcel\Classes\PHPExcel\IOFactory.php(269): PHPExcel_Reader_Excel2007->canRead('C:\Windows\Temp...') #1 C:\Inetpub\vhosts\webwhisperer.com.au\watermark\system\PHPExcel\Classes\PHPExcel\IOFactory.php(207): PHPExcel_IOFactory::createReaderForFile('C:\Windows\Temp...') #2 C:\Inetpub\vhosts\webwhisperer.com.au\watermark\admin\model\catalog\productimportexport.php(1208): PHPExcel_IOFactory::identify('C:\Windows\Temp...') #3 C:\Inetpub\vhosts\webwhisperer.com.au\watermark\admin\controller\catalog\productimportexport.php(352): ModelCatalogProductImportExport->upload('C:\Windows\Temp...', '1') #4 [internal function]: ControllerCatalogProductImportExport->bulk() #5 C:\Inetpub\vhosts\webwhisperer.com.au\watermark\vqmod\ in C:\Inetpub\vhosts\webwhisperer.com.au\watermark\system\PHPExcel\Classes\PHPExcel\Reader\Excel2007.php on line 168

有谁知道有什么问题就在这里提前..thanks

堆栈跟踪的顶部会告诉你答案:

Could not open C:\Windows\Temp\php479C.tmp for reading! File does not exist. 

的PHPExcel类是无法打开该文件因为它不存在。查看堆栈跟踪,这是由ModelCatalogProductImportExport对象的'upload'方法上传的。我会确保这个函数正确地导入文件,并且在通过文件运行PHPExcel类函数之前将它保存到正确的目录中。