Jump to content

[SOLVED] Browser Timeout


onegative

Recommended Posts

Good day everyone,

 

I am trying to overcome a problem with a PHP script that performs a MySQL query using RegEx to locate records which can take as long as 3 or 4 minutes to return the results.  Well that isn't the real problem because the query is doing the best it can due to what information it is trying to be extract from the records.  The real problem is that exactly 180 seconds after I start the query my Browser times out with the standard Network Error (tcp_error) which then prevents the results from being returned to the browser.  I have attempted to do all type of things in the httpd.conf, php.ini and even the IE registry to prevent this from occurring.  Can anyone help me understand what I can do to get around this problem?  In the php script once it issues the mysql query the script halts until the results are returned so I am not sure if there is some way to keep the browser active prior to the mysql query so that it does not timeout...I still can't figure where the 180 seconds timeout is actually set else I would even try to extend it to 300 seconds...

 

Any and all suggestions would be greatly appreciated...

 

Thanks,

Danny

Link to comment
Share on other sites

The main timeout limit is set in php.ini if you have already changed that then something else is wrong, either it's not listening to it's config file (unlikely) or something else in the script is causing it to error or timeout, I don't know much about RegEx but maybe it's that?

Link to comment
Share on other sites

Apache's default timeout is usually 300, but check your settings.

 

I used this to check:

cat /etc/apache2/apache2.conf | grep "Timeout" | head -n 2 

 

And it gave me:

 

# Timeout: The number of seconds before receives and sends time out.

Timeout 300

 

Check yours.

 

Link to comment
Share on other sites

Yes I have it set to 1200.  I have tried changing virtually every configuration setting I can think of but still "No Joy".  The funny thing is that it is a consistent 180 second timeout but I can't figure where it is set.  The php page is a PHP_SELF so I start out placing the text I intend on using in my SQL query which if it returns the search before the 180 seconds everything is fine.  But if the SQL query exceeds 180 seconds I get the following message...

 

Network Error (tcp_error)

 

A communication error occurred: "" 

The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time. 

 

I just can't figure out where this timeout is set.

 

Danny

Link to comment
Share on other sites

Of course, I have restarted the web server so many times I can do it with my eyes closed...just can't figure out where this timeout exist.

 

I felt obligated to ask.  You have no idea how many times people don't do that and then ask for help. @_@

 

Do you have an .htaccess files that are overriding it?  Is your MySQL server killing any requests that take longer than 180 seconds and not notifying PHP for whatever reason?

Link to comment
Share on other sites

Sorry wasn't trying to be a smart @ss...

 

And no .htaccess in play here.  The MySQL query continues to run and I can confirm that by using PHPADMIN to watch the MySQL process that is performing the query.  The funny thing is that I still don't understand what timeout is actually happening.  If my query is shorter than 180 seconds everything is fine and dandy but if it takes 181+ seconds I get the Browser Network Error message about the web server being too busy or unavailable.  The php query that performs the SELECT starts and of course the web page sits there as the query occurs and then the magic 180 second passes and the page times out...where in the world could this time out exist???  Is it possible that the web browser itself is the issue???  I have even modified/added some registry entries that is suppose to increase the Browser's time out but it does not help...

 

Does anyone have this problem???

 

Thanks for your help,

Danny

Link to comment
Share on other sites

So I finally figured out my problem...seems that our http proxy.pac contains a timeout variable which was causing my Browser Timeout...whenever it did not receive a response within 180 seconds...

 

Unbelievable...

 

Thanks everyone for the suggestions though...

 

Danny

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.