所以我正在尝试在我的 Google Cloud App Engine 中使用 PHP 编写一个 PPT 文件。
写入文件的最终代码是
$xmlWriter = IOFactory::createWriter($phpPresentation, "PowerPoint2007");
$xmlWriter->save("php://output");
它在我的本地主机中工作,但是当我将它部署到谷歌云时,它ERR_INVALID_RESPONSE
在谷歌浏览器和File Not Found
mozilla firefox 中出现错误。
当我访问日志时,它说
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 中创建可写目录吗?