----- Original Message ----- 
From: "chris smith" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <php-db@lists.php.net>
Sent: Friday, January 05, 2007 12:08 PM
Subject: Re: [PHP-DB] CURL and process not finishing


> On 1/5/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> 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


<br><br><br>************************************************************************<br>
<br>
IMPORTANT NOTICE<br>
<br>
This communication is for the exclusive use of the intended recipient(s)<br>
named above. If you receive this communication in error, you should<br>
notify the sender by e-mail or by telephone (+44) 191 224 4461, delete<br>
it and destroy any copies of it.<br>
<br>
This communication may contain confidential information and material<br>
protected by copyright, design right or other intellectual property<br>
rights which are and shall remain the property of Piranha Studios<br>
Limited. Any form of distribution, copying or other unauthorised use<br>
of this communication or the information in it is strictly 
prohibited.<br>Piranha Studios Limited asserts its rights in this communication 
and<br>
the information in it and reserves the right to take action against<br>
anyone who misuses it or the information in it.<br>
<br>
Piranha Studios Limited cannot accept any liability sustained as a<br>
result of software viruses and would recommend that you carry out your<br>
own virus checks before opening any attachment.<br>
<br>
*************************************************************************<br>
<p><br>
AdmID:DC2682BF35FB6210D35D5596334DA601



**********************************************************************

IMPORTANT NOTICE

This communication is for the exclusive use of the intended recipient(s)
named above. If you receive this communication in error, you should
notify the sender by e-mail or by telephone (+44) 191 224 4461, delete
it and destroy any copies of it.

This communication may contain confidential information and material
protected by copyright, design right or other intellectual property
rights which are and shall remain the property of Piranha Studios
Limited. Any form of distribution, copying or other unauthorised use
of this communication or the information in it is strictly prohibited.
Piranha Studios Limited asserts its rights in this communication and
the information in it and reserves the right to take action against
anyone who misuses it or the information in it.

Piranha Studios Limited cannot accept any liability sustained as a
result of software viruses and would recommend that you carry out your
own virus checks before opening any attachment.

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

Reply via email to