<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How To Run A PHP Script In The Background</title>
	<atom:link href="http://w-shadow.com/blog/2007/10/16/how-to-run-a-php-script-in-the-background/feed/" rel="self" type="application/rss+xml" />
	<link>http://w-shadow.com/blog/2007/10/16/how-to-run-a-php-script-in-the-background/</link>
	<description>A blog about web development, software business, and WordPress</description>
	<lastBuildDate>Wed, 08 Feb 2012 21:10:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Running a PHP script in the background &#8212; Matt Geri</title>
		<link>http://w-shadow.com/blog/2007/10/16/how-to-run-a-php-script-in-the-background/comment-page-3/#comment-197343</link>
		<dc:creator>Running a PHP script in the background &#8212; Matt Geri</dc:creator>
		<pubDate>Fri, 20 Jan 2012 10:21:49 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/10/16/how-to-run-a-php-script-in-the-background/#comment-197343</guid>
		<description>[...] the first. If you want a very good tutorial on how to do the above two methods, then check out this tutorial on w-shadow.com. It gives you code samples and explains quite a bit of [...]</description>
		<content:encoded><![CDATA[<p>[...] the first. If you want a very good tutorial on how to do the above two methods, then check out this tutorial on w-shadow.com. It gives you code samples and explains quite a bit of [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jānis Elsts</title>
		<link>http://w-shadow.com/blog/2007/10/16/how-to-run-a-php-script-in-the-background/comment-page-3/#comment-197059</link>
		<dc:creator>Jānis Elsts</dc:creator>
		<pubDate>Wed, 11 Jan 2012 07:51:50 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/10/16/how-to-run-a-php-script-in-the-background/#comment-197059</guid>
		<description>@ Travis: If you use the first approach (&lt;a href=&quot;http://php.net/manual/en/function.popen.php&quot; rel=&quot;nofollow&quot;&gt;the popen() function&lt;/a&gt;), you could modify the script to return the file pointer that it creates instead of closing it immediately, and then check its status by calling &lt;a href=&quot;http://www.php.net/manual/en/function.feof.php&quot; rel=&quot;nofollow&quot;&gt;feof()&lt;/a&gt; on the pointer.

Something like this:
[sourcecode lang=&quot;php&quot;]
$fp = launchBackgroundProcess($command);
//...other code...
if (feof($fp)) {
    //The process has completed.
}
[/sourcecode]

Note: One of the user comments on the popen() page claims that feof() will only ever return TRUE if you try to read from the file pointer at least once. I don&#039;t know if this is true, but it&#039;s something to keep in mind as a possible source of bugs.</description>
		<content:encoded><![CDATA[<p>@ Travis: If you use the first approach (<a href="http://php.net/manual/en/function.popen.php" rel="nofollow">the popen() function</a>), you could modify the script to return the file pointer that it creates instead of closing it immediately, and then check its status by calling <a href="http://www.php.net/manual/en/function.feof.php" rel="nofollow">feof()</a> on the pointer.</p>
<p>Something like this:</p>
<pre class="brush: php; title: ; notranslate">
$fp = launchBackgroundProcess($command);
//...other code...
if (feof($fp)) {
    //The process has completed.
}
</pre>
<p>Note: One of the user comments on the popen() page claims that feof() will only ever return TRUE if you try to read from the file pointer at least once. I don&#8217;t know if this is true, but it&#8217;s something to keep in mind as a possible source of bugs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carl</title>
		<link>http://w-shadow.com/blog/2007/10/16/how-to-run-a-php-script-in-the-background/comment-page-3/#comment-197006</link>
		<dc:creator>Carl</dc:creator>
		<pubDate>Tue, 10 Jan 2012 10:17:50 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/10/16/how-to-run-a-php-script-in-the-background/#comment-197006</guid>
		<description>Thank you very much for this post.

I have been searching for weeks for a solution like this and am so grateful for your work!</description>
		<content:encoded><![CDATA[<p>Thank you very much for this post.</p>
<p>I have been searching for weeks for a solution like this and am so grateful for your work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Travis</title>
		<link>http://w-shadow.com/blog/2007/10/16/how-to-run-a-php-script-in-the-background/comment-page-3/#comment-197005</link>
		<dc:creator>Travis</dc:creator>
		<pubDate>Tue, 10 Jan 2012 09:03:49 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/10/16/how-to-run-a-php-script-in-the-background/#comment-197005</guid>
		<description>Hi Janis, 
  is there a way to add a callback function/to be notified when the background process is completed?  Thanks!</description>
		<content:encoded><![CDATA[<p>Hi Janis,<br />
  is there a way to add a callback function/to be notified when the background process is completed?  Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jānis Elsts</title>
		<link>http://w-shadow.com/blog/2007/10/16/how-to-run-a-php-script-in-the-background/comment-page-3/#comment-196846</link>
		<dc:creator>Jānis Elsts</dc:creator>
		<pubDate>Fri, 06 Jan 2012 14:46:18 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/10/16/how-to-run-a-php-script-in-the-background/#comment-196846</guid>
		<description>As far as I know, there&#039;s no easy way to do HTTPS with plain sockets (fsockopen). You&#039;ll probably want to change the script to use cURL instead. With an appropriately low connection timeout, cURL should close the connection right away - just like the script above does.</description>
		<content:encoded><![CDATA[<p>As far as I know, there&#8217;s no easy way to do HTTPS with plain sockets (fsockopen). You&#8217;ll probably want to change the script to use cURL instead. With an appropriately low connection timeout, cURL should close the connection right away &#8211; just like the script above does.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vivek</title>
		<link>http://w-shadow.com/blog/2007/10/16/how-to-run-a-php-script-in-the-background/comment-page-3/#comment-196820</link>
		<dc:creator>Vivek</dc:creator>
		<pubDate>Fri, 06 Jan 2012 01:12:58 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/10/16/how-to-run-a-php-script-in-the-background/#comment-196820</guid>
		<description>Hi there...this is great!  what edits would I need to make if I wanted to do this on an HTTPS request?  On cURL I used to do SSL_VERFY_PEER set to false..anything I can do here?</description>
		<content:encoded><![CDATA[<p>Hi there&#8230;this is great!  what edits would I need to make if I wanted to do this on an HTTPS request?  On cURL I used to do SSL_VERFY_PEER set to false..anything I can do here?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jānis Elsts</title>
		<link>http://w-shadow.com/blog/2007/10/16/how-to-run-a-php-script-in-the-background/comment-page-3/#comment-193707</link>
		<dc:creator>Jānis Elsts</dc:creator>
		<pubDate>Thu, 24 Nov 2011 09:51:21 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/10/16/how-to-run-a-php-script-in-the-background/#comment-193707</guid>
		<description>Those are the output parameters for the error number and error message. See the &lt;a href=&quot;http://php.net/manual/en/function.fsockopen.php&quot; rel=&quot;nofollow&quot;&gt;fsockopen documentation&lt;/a&gt; for (slightly) more details.</description>
		<content:encoded><![CDATA[<p>Those are the output parameters for the error number and error message. See the <a href="http://php.net/manual/en/function.fsockopen.php" rel="nofollow">fsockopen documentation</a> for (slightly) more details.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrei</title>
		<link>http://w-shadow.com/blog/2007/10/16/how-to-run-a-php-script-in-the-background/comment-page-3/#comment-193639</link>
		<dc:creator>Andrei</dc:creator>
		<pubDate>Wed, 23 Nov 2011 17:43:49 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/10/16/how-to-run-a-php-script-in-the-background/#comment-193639</guid>
		<description>Thank you for this information. Very useful!

Question: for the following code, who is $errno and $errstr?
$fp = fsockopen($parts[&#039;host&#039;], isset($parts[&#039;port&#039;])?$parts[&#039;port&#039;]:80, $errno, $errstr, 30);</description>
		<content:encoded><![CDATA[<p>Thank you for this information. Very useful!</p>
<p>Question: for the following code, who is $errno and $errstr?<br />
$fp = fsockopen($parts['host'], isset($parts['port'])?$parts['port']:80, $errno, $errstr, 30);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: swellendam accommodation</title>
		<link>http://w-shadow.com/blog/2007/10/16/how-to-run-a-php-script-in-the-background/comment-page-3/#comment-180365</link>
		<dc:creator>swellendam accommodation</dc:creator>
		<pubDate>Tue, 20 Sep 2011 01:53:19 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/10/16/how-to-run-a-php-script-in-the-background/#comment-180365</guid>
		<description>Wow, fantastic weblog format! How lengthy have you ever been running a blog for? you made running a blog look easy. The full glance of your website is great, let alone the content material!</description>
		<content:encoded><![CDATA[<p>Wow, fantastic weblog format! How lengthy have you ever been running a blog for? you made running a blog look easy. The full glance of your website is great, let alone the content material!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Download HD Trailer</title>
		<link>http://w-shadow.com/blog/2007/10/16/how-to-run-a-php-script-in-the-background/comment-page-3/#comment-169607</link>
		<dc:creator>Download HD Trailer</dc:creator>
		<pubDate>Wed, 18 May 2011 14:51:04 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/blog/2007/10/16/how-to-run-a-php-script-in-the-background/#comment-169607</guid>
		<description>Thanks for this! I&#039;ll check this site everyday and looking for some posts like this.</description>
		<content:encoded><![CDATA[<p>Thanks for this! I&#8217;ll check this site everyday and looking for some posts like this.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

