我正在致力于laravel 5.2中的cron作业,当时我尝试从计划调用控制器函数来创建Excel工作表获取错误。但邮递员运行良好。ZipArchive :: close():未能在AWS EC2 Linux中创建临时文件
ZipArchive::close(): Failure to create temporary: No such file or directory' in /var/www/html/Expenses/vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007.php:398
问题与zipArchive临时文件的权限?
我将phpexcel表保存到目录(777)时出现以上错误。
$excel_path = 'SubmittedSheets/'.$userId.'-'.uniqid().'.xlsx';
$objWriter->save($excel_path);
您配置为PHP的临时文件夹的文件夹是否真的存在?如果是这样,您的脚本是否可以访问它? (记住一个cron作业可能作为一个不同的用户运行,而不是web访问) –
https://laracasts.com/discuss/channels/servers/ziparchiveclose-failure-to-create-temporary-file-no-such-file - 或 - 目录 – hassan
@hassan - 我看到了这个解决方案,但不清楚。请解释你是否知道。 – 151291