My framework is Thinkphp. I use phpExcel to export data. I can export only about 500 data records. If I increase the number, the memory will overflow. Because the exported data is not in a data table and multiple tables need to be recycled, do you have any good solutions, or what does phpExcel need to be configured to solve this problem? My framework is Thinkphp. I use phpExcel to export data, and I can export only 500 data records. When I increase the number, the memory will overflow. Because the exported data is not in a data table and multiple tables need to be recycled, do you have any good solutions, or what needs to be configured in phpExcel to solve this problem?
Reply content:
My framework is Thinkphp. I use phpExcel to export data. I can export only about 500 data records. If I increase the number, the memory will overflow. Because the exported data is not in a data table and multiple tables need to be recycled, do you have any good solutions, or what needs to be configured in phpExcel to solve this problem?
Let's take a look at the maximum storage modification of php.
My solution is to export data in segments. However, if you have 500 records, you should optimize the code for memory overflow. You need to add an index to the fields that are queried multiple times.
Https://segmentfault.com/q/1010000004388...