Jump to content

Connection timeout in sqlsrv_connect() not working


xfirebg

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

LoginTimeout

Key

 

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

extension=php_sqlsrv_7_ts.dll 

And the php code is:

$serverName = "172.18.0.52"; //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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.