This is probably a very simple answer that I'm missing.
I have index.php and qeury.php in the same directory. Users visit index.php, which prints some info. It then needs to call qeury.php and exit, without waiting for query to finish running. Query just pings a server and then exits.