[FX.php List] 5 minute timeout?

David Ness dness at bondedbuilders.com
Tue Aug 29 12:05:25 MDT 2006


I looked at my 'Keep-Alive' setting in my webserver, Microsoft's IIS v6,
and it was on (which is what I think I would want) and set to 1200
seconds (20 minutes). Turning it off had no effect. I've turned it back
on.

Thanks for the suggestion, though.

I feel certain the problem is that the page being sent to the browser is
not completed in 5 minutes, resulting in a 'timeout' being initiated by
the client browser.

I pursued having PHP echo text to the display and then flushing it, and
this did indeed result in a browser window being updated with new
content ever few seconds, but did NOT stop the 5 minute mark 'timeout'.
I suspect this is because the page/PHP script was not COMPLETED within
that timeframe. I think the browser is looking for the page to be
completed within 5 minutes or it times out the connection, resulting in
the PHP script that was running to stop also.

I would have thought there would be a browser preference, or better yet,
a html head or meta tag that I could add to my page that informs the
client browser to work with a timeout of a value of the developer's
setting.

Does anyone else run a PHP script of any type that executes in over 5
minutes?

Any more ideas?


--
David Ness,
Database Systems Programmer
 
Bonded Builders Warranty Group
1500 Kings Highway
Port Charlotte, FL 33980
800.749.0381 x3123 (National Toll Free)
941.255.3274 x3123 (Local)
 

-----Original Message-----
From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Marisa Smith
Sent: Tuesday, August 29, 2006 1:27 PM
To: FX.php Discussion List
Subject: Re: [FX.php List] 5 minute timeout?

David-

I'm not sure if you are using Apache or not, but if so you might want to
look at your timeout settings there.  I had this problem a while  
back and had to tweak some stuff in the httpd.conf file.   I think  
the default "keepalive" connection is something like 300 seconds, which
would explain your 5 minute timeout issue.  You can check this out by
printing the results of phpinfo() and looking at the apache timeouts
area.  Unfortunately, I don't have time to look up the exact setting
right now, but thought this might be helpful.

Marisa


On Aug 29, 2006, at 11:52 AM, David Ness wrote:

> Dale, thanks for the suggestion.
>
> Moving the 'set_time_limit' outside the loop had no effect. Also, I 
> see that I was mistaken in my belief that the log error quoted below 
> was thrown upon 'timeout'. It isn't. The error came from some other 
> condition not related to this problem.
>
> During my latest test, the 'timeout' did occur, and the php error log 
> remained clear.
>
> I'm re-reading the additional comments on 
> http://us2.php.net/set_time_limit and I think the solution is there. 
> You can't leave a browser waiting for new data for 5 minutes. I'm 
> going to try some solutions which involve flushing output to the 
> browser periodically. Something like:
>
> ob_start();
> While loop
> {
> 	Do the things that take a log time
> 	echo ".";
> 	flush();
> 	ob_flush();
> }
>
> I'll report back later after trying a few potential solutions.
>
>
> --
> David Ness,
> Database Systems Programmer
>
> Bonded Builders Warranty Group
> 1500 Kings Highway
> Port Charlotte, FL 33980
> 800.749.0381 x3123 (National Toll Free)
> 941.255.3274 x3123 (Local)
>
>
> -----Original Message-----
> From: fx.php_list-bounces at mail.iviking.org
> [mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Dale 
> Bengston
> Sent: Tuesday, August 29, 2006 11:20 AM
> To: FX.php Discussion List
> Subject: Re: [FX.php List] 5 minute timeout?
>
> Hi David,
>
> Try using set_time_limit at the top of the html page being loaded 
> instead of within the while loop. I think it's designed to work per- 
> script, not per-iteration of a loop.
>
> Regards,
> Dale
>
> On Aug 29, 2006, at 10:12 AM, David Ness wrote:
>
>> My fx.PHP solution has a feature where the user can 'batch upload'
>> data
>> to a FileMaker table using a properly formatted csv file. I've got 
>> everything working great, except I can't get the page to stop timing 
>> out after 5 minutes. I get about 320 records posted (of a test set of

>> 1000), then the script stops, throwing the following error to the php

>> error
>> log:
>>
>> [29-Aug-2006 10:53:48] PHP Warning:  fsockopen() [<a
>> href='function.fsockopen'>function.fsockopen</a>]: unable to connect 
>> to 10.10.10.4:80 (A connection attempt failed because the connected 
>> party did not properly respond after a period of time, or established

>> connection failed because connected host has failed to respond.
>>
>> 10.10.10.4 being my FM WPE.
>>
>> The basic structure of the php code is:
>>
>> $handle = fopen("uploadedfilename.csv", "r"); while (($importdata = 
>> fgetcsv($handle, 0, ",")) != FALSE) {
>> 	set_time_limit( 50000 );
>> 	$newApplication->AddDBParam('builder_reference_number',
>> $importdata[0]  );
>> 	$newApplication->AddDBParam('builder_number', $importdata[1] );
>> 	$newApplication->AddDBParam('homeowner_firstname',
>> $importdata[2]  );
>> 	$newApplication->AddDBParam('homeowner_lastname', $importdata[3]
> );
>> 	$newApplicationResult = $newApplication->FMNew(); } // end of
> while
>> fclose($handle);
>>
>>
>> As you can see, I've tried playing around with the usual subjects; 
>> max_execution_time, max_input_time, and set_time_limit.
>>
>> My ini info is located at:
>> http://www.bondedbuilders.com/builderportal_development/phpinfo.php
>>
>>
>> I use a MS IIS v6 server, and don't see any options there (though I'm

>> not ruling out the solution being there), and I also wondered if the 
>> solution lies in placing some statement in the HTML HEADER of the 
>> page, which I haven't found.
>>
>> If you know of any potential solutions to this timeout problem, 
>> please offer them up!
>>
>> Thanks!
>>
>> --
>> David Ness,
>> Database Systems Programmer
>>
>> Bonded Builders Warranty Group
>> 1500 Kings Highway
>> Port Charlotte, FL 33980
>> 800.749.0381 x3123 (National Toll Free)
>> 941.255.3274 x3123 (Local)
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list

_______________________________________________
FX.php_List mailing list
FX.php_List at mail.iviking.org
http://www.iviking.org/mailman/listinfo/fx.php_list


More information about the FX.php_List mailing list