I need to run a second php file in the background. The problem is that this file needs to only run 20 seconds after the current file has completed. I have used exec("php test_script.php") to run the file but I cant get it to wait. If I use sleep() if halts my current script.
To be a bit more specific. I am uploading a file to a remote server. I then need to wait approximately 20 seconds after completing the upload to check the server for a response. In the meantime I would like to carry on with the current file. The second file will do what is needed in the background. At the moment I have to wait then run the second file.