Originally, I exported it to XLSX format and used
$objWriter = IOFactory::createWriter($objPHPExcel, 'Excel2007');
to report errors. The problem is that it is fine in the development environment and test environment, but it will directly cause a 500 error in the production environment.
Later I changed to export XLS format,
$objWriter = IOFactory::createWriter($objPHPExcel, 'Excel5');
The problem was solved, I will study the specific reason when I have time! ! !
The above-mentioned solution to the 500 error when exporting PHPExcel in the Linux environment is all the content shared by the editor. I hope it can give you a reference, and I hope you will support the PHP Chinese website.
For more related articles on how to solve the 500 error reported by PHPExcel when exporting in the Linux environment, please pay attention to the PHP Chinese website!