ZipArchive :: close (): Failed to create temporary file on AWS EC2 Linux

I am working on cron jobs in laravel 5.2 when I am trying to call a controller function from a graph to generate an Excel error. but works great in postman.

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

Temp file resolution issue for zipArchive?

I am getting above error while saving phpexcel sheet to directory (777).

$excel_path = 'SubmittedSheets/'.$userId.'-'.uniqid().'.xlsx';
$objWriter->save($excel_path);

      

+3


source to share


1 answer


An absolute path is required to save the excel file in AWS Ec2 Linux for PHPExcel.



$excel_path = '/var/www/html/MyProject/public/SubmittedSheets/'.$userId.'-'.uniqid().'.xlsx';
$objWriter->save($excel_path); 

      

+2


source







All Articles