I have a really long php script (up to 4 hours) and the script part works fine. it runs the entire 4h. doesnt timeout But i want the result in my browser, and on the browser side, after +- 35-40min the browser stops loading (firefox) and just returns an empty page.
I know there are probably a dozen ways to get the result to me, without having the browser open. But i am not looking for that.
I really have no idea where to start with troubleshooting this issue. Like, is this a browser or a server issue? things to note:
- The php script does not stop when the browser returns an empty screen (no error message, and the script itself keeps running)
- If i split the script and make it refresh the browser window after 10min, it still returns an empty page after +-40min
- if i run 2 scripts, they stop at the same time
- no error messages on my servers side
- the same issue happens if i simply have a script with sleep(4800); in it
the php script starts with:
set_time_limit(0);
ini_set('max_execution_time', '0');
in htaccess i have:
RewriteRule (myfile)\.php - [E=noconntimeout:1]
RewriteRule (myfile)\.php - [E=noabort:1]
in php.ini i have execution time to -1 and 4096m memory etc.
tldr: browser sort of times out (no error, but returns empty screen) while script goes on. how do i prevent this, or what area should i look to find the issue?
edit: if i build in a loop, and split the sleep(4800); example to: sleep(1200); then with javascript reload the page (4 times total). i still get the same issue
<script type="text/javascript">
var php_varurl = "<?php echo myurl; ?>";
newwindow=window.open(php_varurl, '_self');
</script>