In a connection to an external server ( MS SQL SERVER ), from another system with which I integrate some data, it is extremely slow, and thus the connection to the database gives error.
How to increase the timeout of the PDB connection with PDO ?
I tried to use array(\PDO::ATTR_TIMEOUT => 10)
as an option on the PDO connection but it generates the following error:
Warning: PDO :: __ construct (): SQLSTATE [IM001]: Driver does not support this function: driver does not support setting attributes in /var/www/core/class/Banco/GkBanco.php on line 25
How to connect to MSSQL
with a longer timeout? can be using any lib that works with linux .
I tried to use setAttribute(\PDO::ATTR_TIMEOUT, 10);
and it generates the following error:
Warning: PDO :: setAttribute (): SQLSTATE [IM001]: Driver does not support this function: driver does not support setting attributes
I tried to add ini_set("default_socket_timeout", 30);
before the connection did not change anything.