|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #66062 PDO_DBLIB support for PDO::ATTR_TIMEOUT
Submitted: 2013-11-08 12:43 UTC Modified: 2014-12-30 10:42 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: sergiu dot ionescu at gmail dot com Assigned:
Status: No Feedback Package: PDO DBlib
PHP Version: Irrelevant OS: Ubuntu 12.04 LTS
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: sergiu dot ionescu at gmail dot com
New email:
PHP Version: OS:


 [2013-11-08 12:43 UTC] sergiu dot ionescu at gmail dot com
I am not sure if this is a bug or just an unsupported feature.
I am interested in setting the connection timeout for a PDO_DBLIB connection to an MSSQL database.
Could you please point me to the right approach?


Test script:

$connection = new PDO(                'dblib:dbname=****;type=pdo_mssql;host=****;model=mssql;active=1;charset=',
                array(PDO::ATTR_TIMEOUT => 1)

Expected result:
I expect the connection to timeout in 1 second.

Actual result:
The connection timeouts in over 10 seconds.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-11-26 14:21 UTC] sergiu dot ionescu at gmail dot com
At this point it seems that this is not possible from the PHP API.
The workaround that i have found is changing the freetds configuration(/etc/freetds/freetds.conf):

connect timeout = 1

This may be closed. 

 [2014-01-01 12:26 UTC]
-Package: PDO related +Package: PDO DBlib
 [2014-10-21 04:28 UTC]
-Type: Bug +Type: Feature/Change Request
 [2014-10-23 06:20 UTC]
-Status: Open +Status: Feedback
 [2014-10-23 06:20 UTC]
Please try using this snapshot:
For Windows:

Actually fixed with commit. Mislabeled as fix for bug #66063
 [2014-12-30 10:42 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Jan 29 14:01:24 2020 UTC