I use this http://phpexcel.codeplex.com/ to export to excel.
need to export 11000 - 65000 rows... but when trying to do this browser hangs up. it do not answer with errors or other messages. just show that request in progress.
top shows that apache finished work. even apache log says that all done:
x.x.x.x - - [28/Jul/2011:12:28:38 +0300] "POST /doctor/lab/statistic/ HTTP/1.1" 200 2773504 "http://x.x.x.x:82/doctor/lab/statistic/" "Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0"
but still no results.
system:
Linux Eearth 2.6.34-12-desktop #1 SMP PREEMPT 2010-06-29 02:39:08 +0200 i686
PHP Version 5.3.5
Apache/2.2.15 (Linux/SUSE)
so the question
EDIT 1
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="'.$filename.'.xls"');
header('Cache-Control: max-age=0');
$writer = PHPExcel_IOFactory::createWriter($xls, 'Excel5');
$writer->save('php://output');
exit;
EDIT 2
i tried to save data to file like this $writer->save('test.xls');
filesize 2.7MB
then if i do this:
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="'.$filename.'.xls"');
header('Cache-Control: max-age=0');
include 'test.xls';
exit;
download starts immediate...
See Question&Answers more detail:os