473,406 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Timeout in HTML

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 <iframewith a reloading status message. But after
one hour without </htmlthe browser (IE) goes on to "the page cannot
be found".

How do I overcome this?

BR
Sonnich

Jul 19 '06 #1
7 1835
Sonnich wrote:
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 <iframewith a reloading status message. But after
one hour without </htmlthe 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
Jul 19 '06 #2

Sonnich wrote:
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.

Jul 19 '06 #3
Sonnich wrote:
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

Jul 19 '06 #4
*** Sonnich escribió/wrote (19 Jul 2006 08:54:33 -0700):
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
--
Jul 19 '06 #5
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

Jul 20 '06 #6
"Sonnich" <so************@elektrobit.comwrote:
>
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 <iframewith a reloading status message. But after
one hour without </htmlthe browser (IE) goes on to "the page cannot
be found".

How do I overcome this?
What do you want to overcome? You have no control over how long the
browser will wait for an answer. It has the right to decide its own
timeout, and give up at any time.

If you really have an operation that will take an hour, you need to use
some kind of periodic "refresh" scheme to have the far end keep checking
for the job to be finished.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Jul 22 '06 #7

Alvaro G. Vicario wrote:
*** Sonnich escribió/wrote (19 Jul 2006 08:54:33 -0700):
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
;-)
Well, if you knew the job, then you would see to, that to slow parts
does not depend on me... just my 2.5 cents.

It is taking a large amount of files from 1 server to 2 others, a job
which itself might take minutes (just finding the files is....) - next
processing data is also a......

Jul 24 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sameer | last post by:
Hello All, I have a simple JSP which looks like this <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <%@ page session="true"%> <HTML> <HEAD> <meta HTTP-EQUIV="refresh"...
4
by: HolaGoogle | last post by:
hi there, i've 2 questions for you guys.... 1: is there any way to "force" a session_onend(), session timeout or at least call my logout method when a user leaves the application window without...
3
by: Carpe Diem | last post by:
Hello I have an aspx page that loses Session("user") value after a few minutes even after I set <sessionState mode="InProc" cookieless="false" timeout="300"> in web.config and wrote function...
3
by: Barb Alderton | last post by:
I wrote a asp.net app for a client to enter Purchase Requisitions for IT purchases (using Session variables). The users want the session timeout to be set to at least an hour because they are...
2
by: Greg Decos | last post by:
I am using forms authentication using a FormsAuthenticationTickets set to expire in 30 minutes and the ticket is added to the collection of cookies. I am not sure where the following values are...
4
by: DavidS | last post by:
First: There are several ways to confuse one regarding session timeout. (1) web.config - <sessionState timeout="20"> (2) IIS Manager | Internet Information Services | ServerNode | Default Web Site...
2
by: GHS | last post by:
I have some code to connect to a website and pull some content out of the HTML. I've verified that the 2 URLs I'm using are perfectly fine in Internet Explorer and both of them return results...
1
by: a.r.austin | last post by:
Hello, I am trying to download a few files one after another from a remote server. Problem is that I don't know how to, or if I am able at all, set a time out for download. I don't want to time...
25
by: =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post by:
I tried: <sessionState timeout="1"> </sessionState> bounced IIS, and after 1 minute still had a session. ??? -- thanks - dave
2
by: Robin Becker | last post by:
While messing about with some deliberate socket timeout code I got an unexpected timeout after 20 seconds when my code was doing socket.setdefaulttimeout(120). Closer inspection revealed that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.