Jump to content

Connection timeout in sqlsrv_connect() not working


Recommended Posts

Hello. I want to to minimize waiting time if i don't have connection to specific remote host.

For example i am checking a DB server for connection. If i don't have connection the time out of the page is approximately 50 seconds. I want to make it 3 second.

Im using




I have installed SQLSRV driver. And i have activated in php.ini.


And the php code is:

$serverName = ""; //Iskar server seizmika
$connectionInfo = array("Database" => "ISKARDB", "UID" => "admin", "PWD" => "admin", "LoginTimeout" => 3);
$conn = sqlsrv_connect($serverName, $connectionInfo);

But the 3 second timeout not working. Its again the ~50sec timeout.


What i can do? Thanks :)

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.