onegative Posted June 10, 2008 Share Posted June 10, 2008 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 Quote Link to comment Share on other sites More sharing options...
Asheeown Posted June 10, 2008 Share Posted June 10, 2008 set_time_limit(0); 0 makes it unlimited, change the 0 to any number of seconds you wish if you don't want to have unlimited Quote Link to comment Share on other sites More sharing options...
onegative Posted June 10, 2008 Author Share Posted June 10, 2008 I already have set_time_limit(900); but the browser still times out at 180 seconds.... Danny Quote Link to comment Share on other sites More sharing options...
Asheeown Posted June 10, 2008 Share Posted June 10, 2008 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? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted June 10, 2008 Share Posted June 10, 2008 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. Quote Link to comment Share on other sites More sharing options...
onegative Posted June 10, 2008 Author Share Posted June 10, 2008 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 Quote Link to comment Share on other sites More sharing options...
DarkWater Posted June 10, 2008 Share Posted June 10, 2008 I hate to ask this, but did you restart the web server after making these changes? >,> Quote Link to comment Share on other sites More sharing options...
onegative Posted June 10, 2008 Author Share Posted June 10, 2008 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. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted June 10, 2008 Share Posted June 10, 2008 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? Quote Link to comment Share on other sites More sharing options...
onegative Posted June 13, 2008 Author Share Posted June 13, 2008 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 Quote Link to comment Share on other sites More sharing options...
onegative Posted June 16, 2008 Author Share Posted June 16, 2008 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.