Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mssql.timeout not functional? 1

Status
Not open for further replies.

MikeBronner

Programmer
May 9, 2001
756
US
I have tried setting mssql.timeout in php.ini to 300 (5 minutes) to no avail. I still get the following error when trying to get query results:
Fatal error: Maximum execution time of 60 seconds exceeded in c:\repository\web sites\eprp\eprptracker\close_case_errors.php on line 112
This is line 112:
Code:
		$o_rs = mssql_query("EXEC get_ct_multi_facilities '" . $a_row[$i]['ct_facility_name'] . "', '" . $a_row[$i]['v_city'] . "', '" . $a_row[$i]['v_state'] . "', '" . $a_row[$i]['v_zip'] . "'");

Any ideas?

Thanks for all your help! :)
 
This may not be a MSSQL timeout issue, but rather a PHP timeout issue.

What is the setting in your php.ini of max_execution_time?



Want the best answers? Ask the best questions! TANSTAAFL!
 
These are the settings of the Resource Limits section. Does this look ok?
max_execution_time = 30 ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
memory_limit = 16M ; Maximum amount of memory a script may consume (8MB)

Take Care,
Mike
 
I increased max_input_time and things seem to be running now. Thanks for the pointer in the right direction!

Take Care,
Mike
 
I don't know.

Generally an error of "Maximum execution time of x seconds exceeded" means that the script has run only as long as your max_execution_time will allow it to run. But your setting doesn't match the number of seconds specified in the error.

Are you sure this is the php.ini that PHP is using? If you create a script that consists entirely of:

<?php
phpinfo();
?>

and point your browser at it, does the setting "Configuration File (php.ini) Path" match the location from where you read that PHP configuration data? I ask because I once fought a problem configuring PHP only to discover I was editing the wrong file.

Also, after you last edited php.ini, did you restart your browser?



Want the best answers? Ask the best questions! TANSTAAFL!
 
It makes sense though, as max_input_time is the timeout for database queries.

I'll check the php.ini location as you suggested.

No, didn't restart the browser. I'll try that too.

Take Care,
Mike
 
php.ini location checks out using your method. Browser restart didn't affect anything.

I haven't had any problems after setting max_input_time. I think max_execution_time is to limit time of actuall php scripts running to prevent infinite loops, etc.

Take Care,
Mike
 
I'm sorry. I don't know why I posted "restart your browser". That's not correct - for the changes in php.ini to take effect, you have to restart your server.



Want the best answers? Ask the best questions! TANSTAAFL!
 
NP :) I also did that, to no appearent effect. :| But I'm not worried anymore, things are working now. Thanks again. :)

Take Care,
Mike
 
and just to state the obvious ... the script with phpinfo() in it should be in the same directory as the script that you are having problems with (for a proper debugging).

sleipnir214 is both right and (a tiny bit) wrong with his concern over the error message and diagnosis.

php should not give the message you got after 60 secs. it should do it after 30 secs. but, there is a bug in 5.1.3 that ignores max_execution_time and uses the value of max_input_time for both settings instead. so whilst the behaviour is wrong it is at least currently expected with this build

see
you must be running a biiig loop (or similar) to hit 30 seconds of execution time (which, of course, does not count in database or file access time).

of course, if you're not running the affected build then i'm probably barking up the wrong tree...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top