PHP PDO dblib (mssql) with persistent connections not working

After the online examples and documentation for PDOs, I have this one line for creating a PDO object using persistent connections:

$p = new PDO('dblib:host=SOMEHOSTNAME;dbname=SOMEDB',$user,$password,[PDO::ATTR_PERSISTENT=>true]); 

An example of official documentation here: http://php.net/manual/en/pdo.connections.php

The error we get is:

SQLSTATE [IM001]: driver does not support this function: driver does not support configuration attributes

+6
source share
1 answer

You can try this by installing the PDO ODBC driver.
If you use the ODBC PDO driver, and your ODBC libraries support the ODBC connection pool (unixODBC and Windows are the two that do this, there may be more), then it is recommended that you do not use persistent PDO connections and leave the caching connection instead to the ODBC Connection pool ... http://php.net/manual/en/pdo.connections.php (example # 4 persistent connections: note 2)

0
source

All Articles