Re: Resource problem affecting Curl functions
| From: | Richard Lynch | Date: | Thu, 28 Sep 2006 17:11:53 +0000 |
| Subject: | Re: Resource problem affecting Curl functions | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-25864@lists.php.net to get a copy of this message | ||
On Thu, September 21, 2006 10:28 am, Mark Krenz wrote:
> <?php
> $ch = curl_init("http://www.cnn.com/");
> $fp = fopen("example_homepage.txt", "w");
In the realm of Voodoo Programming, but worth a shot nonetheless...
curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.cnn.com');
I vaguely recall a problem back in the day where under some
circumstances the arg to curl_init was messing me up. This could
EASILY have been that I had a typo in my own arg, of course. It's a
Swiss-cheese memory...
> When it fails to work due to having too many vhosts turned on,
> nothing
> is written to the file and my browser just sits there waiting for the
> page to complete. Interestingly enough, things like
> max_execution_time
> doesn't seem to stop the request after the allotted time. It can sit
> there for 10+ minutes and never stop.
No surprise.
PHP only "counts" CPU time that PHP is spending, not CPU time that
curl or MySQL or exec() or extension xyz is spending.
You should be able to set a curl time out though, so you can at least
kill off this script when it is taking too long...
Any followup on this bit should move back to PHP-General, I should think.
--
Like Music?
http://l-i-e.com/artists.htm