title: Why does PHP throw a 404 error after running for 180 seconds?
body: <p>I have a PHP script, which works fine. Sometimes, it needs to run for longer than 30 seconds, so I have increased the max_execution_time to 6000.</p>
  <p>The problem I now have is that for long queries (longer than three minutes), I get a 404 error.</p>
  <p>I know that script is working, as I can see changes in the files that I am updating, but it does not complete.</p>
  <p>I think (but not sure) that the web page does not get a response (as the script is still running and despite doing echo's they are not reflected yet).</p>
  <p>I am not that savvy when it comes to tracking these type of problems down but trying to google this issue, I read that the network tab might be useful to look at.</p>
  <p>Not sure if the following screen shots are useful, but thought they might be.</p>
  <p><a href="https://i.stack.imgur.com/AdrF3.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AdrF3.jpg" alt="Inspect: Network/Timing" /></a></p>
  <p><a href="https://i.stack.imgur.com/oKD9h.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oKD9h.jpg" alt="Inspect: Network/Response" /></a></p>
  <p><a href="https://i.stack.imgur.com/SWowj.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SWowj.jpg" alt="Inspect: Network/Headers" /></a></p>
  <p>Wonder if anybody can help?</p>
  <p>I am running Google Chrome (Version 85.0.4183.83 (Official Build) (64-bit)), but have also tried on Brave, with the same result.</p>