I wrote a PHP application which generates Excel file by using database data. I am using well-known library PHPExcel. Everyone who has work with this library knows that the memory management is the worst point of this library.
So, my question is is it okay to boost up memory until I write my excel and then bring it down?
Something like,
error_reporting(1);
ini_set('memory_limit', '500M');
@set_time_limit(0);
once finish
error_reporting(1);
ini_set('memory_limit', '128M');
@set_time_limit(0);
There’s no need to set it back down.
ini_setonly affects the current request, not the whole server; it’s implicitly set back to the server default once your request finishes.