Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

MarioMacedo's avatar

Generate and return file asynchronously

Hey,

I'm using Laravel-Excel to export a big amount of data (>30000 excel rows) from my tables to an excel file. The query and all the processing is pretty fast, however the generation of the excel file itself is pretty slow and the request expire giving the error:

Maximum execution time of 30 seconds exceeded

I tried increased the max_execution_time to something bigger than 30 seconds but anything changes and the max_execution_time remains as 30 seconds. This was the code I tried to add in my .htaccess

<IfModule mod_php7.c>
    php_value max_execution_time 60
</IfModule>

So, there is any way to generate the file in background and when it finish return it to the user so he can download it directly? Without sending it through email or something else?

Thanks in advance.

0 likes
0 replies

Please or to participate in this conversation.