Allowed memory size exhausted

Nov 2, 2011 at 1:50 AM

I am facing a problem about I need to export lots of data to excel.

I develop a svript. When database data is not too much. That can export to excel normally. But when database data  is too many..Server display error

Allowed memory size of 134217728 bytes exhausted (tried to allocate 67 bytes)

I also setted server memory limit 128M. But also cannot work. How can I do?

Nov 3, 2011 at 12:20 PM

I have a idea

if I can temporary store the generated excel file in server.

So I can make program to separate a fews parts of data to run fews times php script to write all data to excel

EG I have 1000 rows of data need to write into excel.

I write a php script separate each 100 rows data run once time of script and generate a excel file temporary into server

Then the script run 10 times. All data can input into excel in server. After that user can download the excel files

Can phpexcel can store excel file in server? 

Nov 3, 2011 at 12:51 PM

Yeah, in fact the first file in Tests, 01simple.php, writes the Excel file in that script's folder on the server.

Nov 3, 2011 at 3:47 PM

But how can I write excel file on the server?