|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #66522 Ping functionality
Submitted: 2014-01-20 15:52 UTC Modified: 2021-06-09 10:53 UTC
Avg. Score:4.5 ± 0.5
Reproduced:4 of 4 (100.0%)
Same Version:3 (75.0%)
Same OS:3 (75.0%)
From: myselfasunder at gmail dot com Assigned:
Status: Open Package: PDO related
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: myselfasunder at gmail dot com
New email:
PHP Version: OS:


 [2014-01-20 15:52 UTC] myselfasunder at gmail dot com
There is a problem with persistent MySQL connections, wherein an abrupt, broken, persistent connection raises a "server has gone away" error. Using the original "mysql" or newer "mysqli" extensions, this can be mitigated by doing a "ping" (mysql_ping(), mysqli_ping(), ->ping()) before a query or other operation is attempted. If the connection is healthy, this is a trivial check similar to a standard heartbeat. If the connection has collapsed, it will be automatically reestablished using the original connection information.

Currently, PDO does not [obviously] support this. I am recommending that support for this functionality be added to PDO core, and implementations be added for each driver where supported, or be translated to a no-op for those that don't.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-10-24 08:29 UTC]
-Package: PDO Core +Package: PDO related
 [2021-06-09 10:53 UTC]
I see no particular reason not to expose the check_liveness method
if already implemented by the driver.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 14 11:01:29 2024 UTC