【发布时间】:2016-01-16 14:06:07
【问题描述】:
所以我正在尝试在我的 Google Cloud App Engine 中使用 PHP 编写一个 PPT 文件。
写入文件的最终代码是
$xmlWriter = IOFactory::createWriter($phpPresentation, "PowerPoint2007");
$xmlWriter->save("php://output");
它在我的本地主机中工作,但是当我将它部署到谷歌云时,它在谷歌浏览器中给出错误 ERR_INVALID_RESPONSE,在 mozilla firefox 中给出错误 File Not Found。
当我访问它说的日志时
PHP Fatal error: Uncaught exception 'Exception' with message 'Could not close zip file vfs://root/temp/.//phppttmp569a45e921e8a8.63056743.' in /base/data/home/apps/s~frrolefrontend/mediascout:ms-080.390023055217794078/mediascout/ppt_export/src/PhpPresentation/Writer/PowerPoint2007.php:320
Stack trace:
#0 /base/data/home/apps/s~frrolefrontend/mediascout:ms-080.390023055217794078/mediascout/ppt_export/samples/Sample_Header.php(72): PhpOffice\PhpPresentation\Writer\PowerPoint2007->save('php://output')
#1 /base/data/home/apps/s~frrolefrontend/mediascout:ms-080.390023055217794078/mediascout/ppt_export/samples/scout_temp.php(381): write(Object(PhpOffice\PhpPresentation\PhpPresentation), 'scout_temp', Array)
#2 {main}
thrown in /base/data/home/apps/s~frrolefrontend/mediascout:ms-080.390023055217794078/mediascout/ppt_export/src/PhpPresentation/Writer/PowerPoint2007.php on line 320
经过一番研究,我发现Uncaught exception 'Exception' with message 'Could not close zip file 是因为目录不可写。
您能告诉我如何在 App Engine 中创建可写目录吗?
【问题讨论】:
标签: php google-app-engine phpexcel phppowerpoint