php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50862 php timeout < mysql timeout
Submitted: 2010-01-27 14:33 UTC Modified: 2010-01-28 08:30 UTC
Votes:2
Avg. Score:2.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: hajo at clansphere dot de Assigned:
Status: Not a bug Package: *Configuration Issues
PHP Version: 5.3.2RC1 OS: Windows (any)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
47 - 29 = ?
Subscribe to this entry?

 
 [2010-01-27 14:33 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-27 15:23 UTC] hajo at clansphere dot de
white screen of death may also be possible as a current result
 [2010-01-27 15:29 UTC] hajo at clansphere dot de
example error msg:

Fatal error: Maximum execution time of 30 seconds exceeded in ***.php on line ***
 [2010-01-27 18:00 UTC] 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 23:01 UTC] hajo at clansphere dot de
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 :)
 [2010-01-28 08:30 UTC] jani@php.net
Yes, you can always set them however you wish. There is no bug here.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 13:01:29 2024 UTC