title: php script stops executing and shows no errors
body: <p>I have a php script that scrapes the web and inserts the scraped data into a database.<br>
  This php script runs for a very long time(about a couple of hours).<br>
  Sometimes, after the script runs for a long time, the php script just stops executing and shows no error.<br>
  The problem isn't caused due to the amount of execution time of the script because i set the php script to an unlimited amount of execution time.      </p>
  
  <pre><code>ini_set('max_execution_time', 0);
  </code></pre>
  
  <p>I also set the php script to show all errors.</p>
  
  <pre><code>ini_set('display_errors',1);
  error_reporting(E_ALL);
  </code></pre>
  
  <p>But I get no error after the php script stops execution.<br>
  I also ran the script in several other computers and i still encounter the same problem, so the problem isn't due to server restrictions either.  </p>
  
  <p>I researched the issue and apparently it's a networking problem.<br>
  The php script stops communicating with the server and disconnects from it(probably because the php script sent a http request and didn't receive any response).  </p>
  
  <p>My question is this:</p>
  
  <p>Is there any way I can check for network disconnections through the php script, and resume the script and try to reconnect if there was a network disconnection?  </p>