<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Tue, 21 May 2013 02:50:20 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Juozas Kaziukenas' Blog:  Prevent scripts from being killed]]></title>
      <guid>http://www.phpdeveloper.org/news/12216</guid>
      <link>http://www.phpdeveloper.org/news/12216</link>
      <description><![CDATA[<p>
<i>Juozas Kaziukenas</i> has <a href="http://dev.juokaz.com/php/prevent-scripts-from-being-killed">a helpful tip</a> you can use on those long-running scripts to keep going - the <a href="http://php.net/set_time_limit">set_time_limit</a> function.
</p>
<blockquote>
I have some very time consuming scripts running through <a href="http://en.wikipedia.org/wiki/Cron">CRON</a> - some nice web scrapping jobs. They are not processing-intense, but rather slow because of slow websites. All these jobs are really hard to divide in to separate scripts (another article), so one script should have no limits to run for hours. However, web servers don't like it by default.
</blockquote>
<p>
He show how you can use the set_time_limit function to free your script of the timeout limitation (which can be a good and bad thing) or having your script output something, like a "processing" message, as it runs through the loop to keep the timeout away. You can also use the <a href="http://php.net/ignore_user_abort">ignore_user_abort</a> function to continue the process even if the user hits the stop button or otherwise closes the request.
</p>]]></description>
      <pubDate>Thu, 26 Mar 2009 13:18:26 -0500</pubDate>
    </item>
  </channel>
</rss>
