Re: CURL and process not finishing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



john@xxxxxxxxxxxxxxxxxxxx wrote:
----- Original Message ----- From: "chris smith" <dmagick@xxxxxxxxx>
To: <john@xxxxxxxxxxxxxxxxxxxx>
Cc: <php-db@xxxxxxxxxxxxx>
Sent: Friday, January 05, 2007 12:08 PM
Subject: Re:  CURL and process not finishing


On 1/5/07, john@xxxxxxxxxxxxxxxxxxxx <john@xxxxxxxxxxxxxxxxxxxx> wrote:
I am using CURL to check pages outside my site on the internet for some
text, then I email someone on my database who supposedly looks after the
site. The script creates a process that does not terminate. It is running
on a scheduled cronjob so eventually my site has over the maximum of 20
processes running and it goes offline.

It may be that some of the pages I check are hard to get a response from, as CURL tries to return the target URL. I have removed any emailing that it does and still get the problem. Is there any way to check that a process is
not terminating after a reasonable time?

http://www.php.net/manual/en/function.set-time-limit.php

Get the php script to terminate after a certain amount of time.

You could also use this curl variable: CURLOPT_CONNECTTIMEOUT

in case it's a connection issue... see http://www.php.net/curl

I'd probably also try setting CURLOPT_VERBOSE to see if that reveals
the actual problem rather than guessing.

--
Postgresql & php tutorials
http://www.designmagick.com/








Thanks, Chris.  This is the output:

<snip>

* About to connect() to www.runawayexchange.com port 80
*   Trying 69.56.206.170... * Connection timed out
* couldn't connect to host
* Closing connection #1

Problems with this one.

* About to connect() to www.uktravelplanner.co.uk port 80
*   Trying 212.227.38.68... * connected
* Connected to www.uktravelplanner.co.uk (212.227.38.68) port 80
GET /links.htm?? HTTP/1.1
Host: www.uktravelplanner.co.uk
Accept: */*

< HTTP/1.1 404 Not Found

That's a bad link there (in case you didn't notice it).


...and there it stops every time. Is this a script time out, as it stops while looking at the site it is finding OK?

Set the set_time_limit to 0 (unlimited). Sounds like the script is just timing out.

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux