ID: 50862 User updated by: hajo at clansphere dot de Reported By: hajo at clansphere dot de Status: Open Bug Type: *Configuration Issues Operating System: Windows (any) PHP Version: 5.3.2RC1 New Comment:
well, i've never seen a script with mysql support that doesn't connect to the mysql server at startup (within lets say 5 seconds). even if so, a good script should check for a working connection on startup to not run into any trouble while proceeding a lot of things before this. changing the connection timeout of mysql might not be the only solution. if php can provide a better error message (e.g. that a mysql connection caused the script to reach the max exec time) it would be fine, too. something close to your solution is going to get into the project files i'm working on, but that is - in my opinion - a workaround for a task that php should handle. at least all i care about is debugging, and that needs matching error reports to whatever happened :) Previous Comments: ------------------------------------------------------------------------ [2010-01-27 18:00:30] ninzya at inbox dot lv What if your script is running for already 50 seconds and you try to connect to mysql, which has connection timeout of 20 seconds? The only thing that might be useful is checking if mysql.connect_timeout > max_execution_time. If so, then alert startup error and abort, since such big timeout does not make any sense. But, what about ini_set() then? I wouldn't care so much about this, you should know your configuration before running scripts on it. ------------------------------------------------------------------------ [2010-01-27 15:29:42] hajo at clansphere dot de example error msg: Fatal error: Maximum execution time of 30 seconds exceeded in ***.php on line *** ------------------------------------------------------------------------ [2010-01-27 15:23:28] hajo at clansphere dot de white screen of death may also be possible as a current result ------------------------------------------------------------------------ [2010-01-27 14:33:09] hajo at clansphere dot de Description: ------------ does it make sense to have the following values for those two settings in the default configuration? took me some time to figure out this caused some unexpected errors while i had to setup a new php testing environment. please consider changing the default php.ini settings for the production- and development-example shipped with php-downloads. Reproduce code: --------------- max_execution_time = 30 mysql.connect_timeout = 60 Expected result: ---------------- the mysql.connect_timeout should be e.g. 10 or 20 seconds. compared to what it is for mssql.connect_timeout (5 by default) that should be enough and show an mysql timeout error. Actual result: -------------- php errors that inform about a timeout in php error functions / error handler or something similar to this ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50862&edit=1