As mentioned in comments, Sessions are the problem - this is because the session file is locked.
Use session_write_close() in your long-running script to unlock the session file, but note that you cannot use $_SESSION variables in that particular script afterwards.