I am using DataTables Server Side processing on tables in my reporting website. I am also using PHPExcel to export the reports to Excel. My php scripts to create the tables for viewing in the browser work fine, but when I try to get the PHPExcel script to work I get an out of memory error like:
I can see that it's erroring in the same place that is was, and with the same error, as when I was trying to process the reports client side. That's why I'm trying to do it on the server. I've searched around, but I've not seen anything about a situation like this.
Any ideas what I can try?
EDIT
When I up the memory to 512 I get the same error, but at a different place:
EDIT 2
This is not a repeat of the question mentioned below. I know that my server has the required memory, it uses it when presenting the data to the browser. It is only when I send that same data to the PHPExcel files that I have this problem. It was mentioned to try something with cell caching, but I don't know what that is in regards to PHPExcel. This is the first time I've tried using it. I've even tried reducing the number of rows being sent to 11 instead of 12,000+ and I still get the error.
UPDATE
I think that I know some of what the problem is now after much testing.
The initial draw to fill the browser screen is only pulling back what is needed for the screen, starts at 25 goes to 150. When I'm trying to export it is trying to pull all of it. the biggest report that I currently have is 65000+ rows and 35 columns, though I have larger ones that are coming. I updated the memory limit to ini_set('memory_limit', '-1');
so that it will use whatever it needs to, and it does.
Now it is timing out after 300 seconds (5 minutes). I tried fixing this with ini_set('MAX_EXECUTION_TIME', 10);
, but that doesn't seem to be doing anything (I probably have it setup wrong will do more research on that).
Now though I need to find what cache method of the PHPExcel library will be the most efficient. I am currently using cache_in_memory_gzip
, but I'm also testing the others as I read about them and they seem possibly better. I'll make another update or answer the question when I complete my testing.