|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42943 Move *timeout initialization from RINIT to connect time
Submitted: 2007-10-12 10:06 UTC Modified: 2007-10-22 22:43 UTC
From: jdolecek at netbsd dot org Assigned:
Status: Closed Package: MSSQL related
PHP Version: 5.2.4 OS: Windows
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:
Solve the problem:
42 - 8 = ?
Subscribe to this entry?

 [2007-10-12 10:06 UTC] jdolecek at netbsd dot org
Value for mssql.timeout is only consulted on PHP engine startup. The value is changeable in script in runtime, but setting it has no effect for newly opened connections. So script gets default timeout set in php.ini, which is 60 seconds in default installation.

This is quite inconvenient in that you need different PHP.INI for web server CGI PHP (where queries are short and you want to cache runaway queries) and batch scripts (which execute long queries and need timeout disabled).

The value used to be applied properly when set in a script in earlier version, perhaps even as recent as 5.1 (but I don't really recall).

Reproduce code:
echo ini_get('mssql.timeout')."\n";
ini_set('mssql.timeout', 1);
echo ini_get('mssql.timeout')."\n";

$c = mssql_connect(host, user, pass)

$s = mssql_query($c, "WAITFOR DELAY '00:00:05'");

Expected result:
Warning: mssql_query(): Query failed in script.php on line 10

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-12 11:58 UTC]
Frank, There was one report about this but that's now "dead". So let's make this the change request for moving the timeout stuff out of RINIT.

 [2007-10-22 22:43 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 23 18:01:30 2024 UTC