<?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>Sun, 19 May 2013 22:52:41 -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>
    <item>
      <title><![CDATA[Paul Reinheimer's Blog: When does a user abort?]]></title>
      <guid>http://www.phpdeveloper.org/news/8773</guid>
      <link>http://www.phpdeveloper.org/news/8773</link>
      <description><![CDATA[<p>
<i>Paul Reinheimer</i> recently <a href="http://blog.preinheimer.com/index.php?/archives/248-When-does-a-user-abort.html">discovered something interesting</a> about how PHP handles users aborts (hitting the stop button in the browser, closing it) and the steps the language follows after that.
</p>
<blockquote>
I was under the impression that when the user hit stop, the script stopped. Which is: bad, and wrong. PHP doesn't detect that the user has terminated the connection, it has no clue, it obligingly continues processing along, until it attempts to send information to the user.
</blockquote>
<p>
The "ignore_user_abort" configuration option in the php.ini controls some of this, allowing for you to specify whether or not the script should go ahead and finish out even after PHP has discovered that the client has been disconnected. There's also a <a href="http://www.php.net/manual/en/function.ignore-user-abort.php">function</a> that allows you to specify the same thing on a script-by-script basis (in both PHP4 and PHP5).
</p>]]></description>
      <pubDate>Wed, 03 Oct 2007 07:52:00 -0500</pubDate>
    </item>
  </channel>
</rss>
