niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » PHP
Timeout in HTML
Post new topic   Reply to topic Page 1 of 1 [6 Posts] View previous topic :: View next topic
Author Message
Sonnich
*nix forums beginner


Joined: 13 Jun 2006
Posts: 23

PostPosted: Wed Jul 19, 2006 3:54 pm    Post subject: Timeout in HTML Reply with quote

Hi all!

I have a PHP script, which in extreme cases take more than one hour to
load. That is on the HTML side, where the browser by some reason might
cut off, before the PHP has finished.

The point is that I can see that the PHP does what it should right
until the end, while the client side says the page could not be found.

I should mention, that a large amount of information is sent to the
client including an <iframe> with a reloading status message. But after
one hour without </html> the browser (IE) goes on to "the page cannot
be found".

How do I overcome this?

BR
Sonnich
Back to top
Mladen Gogala
*nix forums Guru


Joined: 11 Mar 2005
Posts: 948

PostPosted: Wed Jul 19, 2006 4:21 pm    Post subject: Re: Timeout in HTML Reply with quote

Sonnich wrote:
Quote:
Hi all!

I have a PHP script, which in extreme cases take more than one hour to
load. That is on the HTML side, where the browser by some reason might
cut off, before the PHP has finished.

The point is that I can see that the PHP does what it should right
until the end, while the client side says the page could not be found.

I should mention, that a large amount of information is sent to the
client including an <iframe> with a reloading status message. But after
one hour without </html> the browser (IE) goes on to "the page cannot
be found".

How do I overcome this?

BR
Sonnich


See set_time_limit and ini_set functions. The "ini_set" can be used to
set the "max_execution_time" parameter value, the same thing as with
"set_time_limit".

--
Mladen Gogala
http://www.mgogala.com
Back to top
Andy Dingley
*nix forums beginner


Joined: 19 Mar 2006
Posts: 11

PostPosted: Wed Jul 19, 2006 4:33 pm    Post subject: Re: Timeout in HTML Reply with quote

Sonnich wrote:

Quote:
I have a PHP script, which in extreme cases take more than one hour to
load.

Make it go faster, or find some notification mechanism to tell users
when a pre-cached version is available, so that tehy can load it
quickly. There's no point in taking this long over a HTTP transaction,
it's likely to get abandoned by timeout at almost any point of the
process, including firewalls and proxies.
Back to top
Toby Inkster
*nix forums Guru Wannabe


Joined: 01 Apr 2005
Posts: 138

PostPosted: Wed Jul 19, 2006 5:55 pm    Post subject: Re: Timeout in HTML Reply with quote

Sonnich wrote:

Quote:
I have a PHP script, which in extreme cases take more than one hour to
load.

Why?

If it's that a particular long-winded administration task (e.g. database
re-indexing) needs to be run on the server occasionally, consider running
the PHP as a schedules job (using e.g. cron) and outputting the result
into a static HTML file for later viewing.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Back to top
Alvaro G. Vicario
*nix forums Guru Wannabe


Joined: 20 Feb 2005
Posts: 148

PostPosted: Wed Jul 19, 2006 9:57 pm    Post subject: Re: Timeout in HTML Reply with quote

*** Sonnich escribió/wrote (19 Jul 2006 08:54:33 -0700):
Quote:
I have a PHP script, which in extreme cases take more than one hour to
load.

Most times I write a script that takes more than 30 seconds to execute and
doesn't download content from third party servers, I find that it's poorly
optimized and I'm able to speed it up improving my code. Just my 2 cents
;-)

--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--
Back to top
Ciaran
*nix forums beginner


Joined: 16 Aug 2005
Posts: 8

PostPosted: Thu Jul 20, 2006 2:25 pm    Post subject: Re: Timeout in HTML Reply with quote

You should look at the following:

http://www.php.net/ignore_user_abort

Tells PHP to keep going even if the browser disconnects. Use this with
care! Bear in mind that a frustrated user hitting refresh 10 times in
quick succession will end up causing 10 parallel processes to start up!

-Ciaran
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [6 Posts] View previous topic :: View next topic
The time now is Thu Dec 04, 2008 3:03 am | All times are GMT
navigation Forum index » Programming » PHP
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts random timeout / delivery temporarily suspended unarcher Postfix 0 Fri Jun 13, 2008 12:33 pm
No new posts CGI-Timeout causing "internal server error"???? Carl Lafferty Perl 6 Thu Jul 20, 2006 8:58 pm
No new posts html processing Chris ( Val ) shell 1 Wed Jul 19, 2006 2:50 pm
No new posts text representation of HTML Ksenia Marasanova python 5 Wed Jul 19, 2006 10:09 am
No new posts problem due to html files, Ashutosh Mohanty Apache 2 Wed Jul 19, 2006 6:43 am

Electricity Suppliers | Internet Advertising | Personal Loans | Credit Cards | Secure Hosting
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.5652s ][ Queries: 16 (0.4716s) ][ GZIP on - Debug on ]