I'm trying to figure out how to run long php scripts without making the user wait forever. I have a script that needs to run several functions that each take several seconds to run.
I'm wondering is there a way I can have my php script return its data to the caller before it has finished running?
<?php
echo http_response_code(200);
sleep(60);
run_other_code();
?>
A very simple example, but I'm looking for the script to echo a response then run the rest of the code in the background. Is something like that even possible?