PHP connects to SQL Server (including Azure SQL) using PDO (PHP Data Objects). By design, it does not support Connection pooling. Instead, it has a feature called Persistent Database Connections.
To use the feature, you must connect to DB like this:
As demonstrated in above example, the value of PDO::ATTR_PERSISTENT in the driver options array needs to be set as true in the PDO constructor. It will not work if you try to set the attribute using PDO:: setAttribute() after instantiation of PDO object. For more info, check the document here.
In case of MySQL, we have the option of using Persistent connections while using MySQLi driver.
If a unused persistent connection for a given combination of host, username, password, socket, port and default database cannot be found in the connection pool, then mysqli opens a new connection. The use of persistent connections can be enabled and disabled using the PHP directive mysqli.allow_persistent. The total number of connections opened by a script can be limited with mysqli.max_links. The maximum number of persistent connections per PHP process can be restricted with mysqli.max_persistent. Please note, that the web server may spawn many PHP processes.
Note: mysql_pconnect extension has been removed from PHP 7.0, and hence is no longer an alternative solution for opening persistent connections.