Re: [PHP-DB] CURL and process not finishing

2007-01-06 Thread john
- Original Message - 
From: "chris smith" <[EMAIL PROTECTED]>

To: <[EMAIL PROTECTED]>
Cc: 
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



[PHP-DB] mysql rereading result set (fetch_assoc)

2007-01-06 Thread lwoods
I'm running thru a result set using fetch_assoc.  Now I want to run through 
it again.

How?

TIA,

Larry Woods 

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



[PHP-DB] MSSQL 6.5 IIS6 PHP 5

2007-01-06 Thread Wickham, Larry
I recently wrote a simple web script to execute a few queries against an
old MS SQL 6.5 server. I developed the script on my XP box running IIS5
any user can run the script with out a problem. However when I moved it
to the production box running IIS6 domain admins can run the script
anyone else gets a MSSQL Connect Failed message. The SQL Server is
running SQL authentication only, not mixed or NT. It doesn't make any
sense to me.
Both environments are running PHP 5.1.6

Thanks for your help

Larry Wickham
[EMAIL PROTECTED]
Systems Operations Specialist
Eastern New Mexico University
1500 S. Ave K
Portales, NM 88130

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



Re: [PHP-DB] CURL and process not finishing

2007-01-06 Thread Niel Archer
Hi

 Are you running this as CLI or from your web-server?  If the latter, use
phpinfo() and check the max_execution_time isn't causing you problems.

Niel

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



Re: [PHP-DB] mysql rereading result set (fetch_assoc)

2007-01-06 Thread Niel Archer
Hi

> I'm running thru a result set using fetch_assoc.  Now I want to run through 
> it again.
> 
> How?

  Save each row into an array first time around, then reset the array
pointer to the beginning, would be one way.

  Or assuming you're using the original MySQL functions, use
mysql_data_seek(0) to reset the internal result pointer, as one minute
scanning the function list in the documentation would tell you

Niel

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