Psyche
Psyche

Reputation: 8783

PHPExcel output error

I have the following code which I run on localhost and works perfectly:

$objWriter = new PHPExcel_Writer_Excel2007($excel);    
header('Content-type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename="'.$excel_file.'"');
$objWriter->save('php://output');

The same code uploaded on another host returns a 404 "File Not Found" error.

Any ideea why?

Upvotes: 4

Views: 7217

Answers (2)

Dev
Dev

Reputation: 71

I was facing the same issue. It was working in local but not on live server. Just confirm below installation on live server and it will work.

  • PHP extension php_zip enabled
  • PHP extension php_xml enabled
  • PHP extension php_gd2 enabled

Upvotes: 4

realtebo
realtebo

Reputation: 25691

Today I combacted against this problem.

I saw that Firefox told me "File not found", but HTTP code in the header was a 500 (server error).

I had a mistake writing a formula; once I corrected the formula the error is disappeared.

I've error reporting at paranoid level, display errors active, and I watched at apache error*.log files, but I've received no comunications from the library/ PHP / Apache about the error.

I foudn the error just commenting out one group row at time in the code until I catched the error.

I've no explanation why this error throws non logs.

Upvotes: 0

Related Questions