Re: [PHP-DB] CURL and process not finishing
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 ** 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. GWAVAsigAdmID:B9D9CBE8FB12087DD379D81D944422A5 ** 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
Re: [PHP-DB] CURL and process not finishing
[EMAIL PROTECTED] wrote: - 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: 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 ** 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. GWAVAsigAdmID:2BD3334DF263C5D649F7A8281AFA95F7 ** 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
Re: [PHP-DB] CURL and process not finishing
Hi leaving me with the question: what does max_execution_time relate to? is it more like a maximum time without activity. max_execution_time is the time php gets to execute code. From the documentation: The maximum execution time is not affected by system calls, stream operations etc. Please see the set_time_limit() function for more details. Niel -- 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
It is on a shared server, max_exec_time is 3000, ie 30 seconds, which yes is probably being exceeded. However, having set the CURL_CONNECTION_TIMEOUT thingy it worked a lot better, and the page kept working long after 30 seconds had expired, leaving me with the question: what does max_execution_time relate to? is it more like a maximum time without activity. I still get processes not finishing and accumulating on the server for several hours, and wonder is it that if the script is terminated by some other function like max_exec_time that the curl_close() does not get called in the script and the process remains. Do I need to run another script on a different cronjob to terminate such processes? John -- 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
[EMAIL PROTECTED] wrote: - 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: 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
Re: [PHP-DB] CURL and process not finishing
- 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
Re: [PHP-DB] CURL and process not finishing
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
[PHP-DB] CURL and process not finishing
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? John
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/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php