Re: CURL and process not finishing

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

 



----- 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:






* About to connect() to www.barcelona-hotel.ws port 80
*   Trying 89.171.73.117... * connected
* Connected to www.barcelona-hotel.ws (89.171.73.117) port 80
GET / HTTP/1.1
Host: www.barcelona-hotel.ws
Accept: */*

< HTTP/1.1 200 OK
< Content-Length: 28177
< Content-Type: text/html
< Content-Location: http://www.barcelona-hotel.ws/index.htm
< Last-Modified: Thu, 16 Mar 2006 10:23:52 GMT
< Accept-Ranges: bytes
< ETag: "466fd4b8e348c61:58b9"
< Server: Microsoft-IIS/6.0
< X-Powered-By: ASP.NET
< Date: Sat, 06 Jan 2007 14:01:46 GMT
* Connection #0 to host www.barcelona-hotel.ws left intact
* 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
* 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
* 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 / HTTP/1.1
Host: www.uktravelplanner.co.uk
Accept: */*

< HTTP/1.1 200 OK
< Date: Sat, 06 Jan 2007 14:03:14 GMT
< Server: Apache/2.0.54 (Fedora)
< X-Powered-By: PHP/5.0.4
< Set-Cookie: PHPSESSID=7bam2tis61sr07qli62q26uvr1; path=/
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< Pragma: no-cache
< Content-Length: 5722
< Connection: close
< Content-Type: text/html
* Closing connection #1
* 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
< Date: Sat, 06 Jan 2007 14:03:14 GMT
< Server: Apache/2.0.54 (Fedora)
< Content-Length: 298
< Connection: close
< Content-Type: text/html; charset=iso-8859-1
* Closing connection #1
* getaddrinfo(3) failed for http::80
* Couldn't resolve host 'http:'
* Closing connection #1
* getaddrinfo(3) failed for http::80
* Couldn't resolve host 'http:'
* Closing connection #1
* About to connect() to www.bed.cz port 80
*   Trying 195.250.146.80... * connected
* Connected to www.bed.cz (195.250.146.80) port 80
GET / HTTP/1.1
Host: www.bed.cz
Accept: */*

< HTTP/1.1 200 OK
< Date: Sat, 06 Jan 2007 14:02:21 GMT
< Server: Microsoft-IIS/6.0
< X-Powered-By: ASP.NET
< X-AspNet-Version: 2.0.50727
< Set-Cookie: ASP.NET_SessionId=gvugeu45lugalf55hu1x5rfq; path=/; HttpOnly
< Cache-Control: private
< Content-Type: text/html; charset=utf-8
< Content-Length: 59347


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

John
--
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