Edit report at http://bugs.php.net/bug.php?id=52561&edit=1
ID: 52561
Comment by: paulgao at yeah dot net
Reported by: paulgao at yeah dot net
Summary: function mysqli_ping no attempted reconnection!
Status: Open
Type: Bug
Package: MySQL related
Operating System: irrelevant
PHP Version: 5.3.3
Block user comment: N
New Comment:
and mysql server version 5.1.49.
Previous Comments:
------------------------------------------------------------------------
[2010-08-07 13:32:26] paulgao at yeah dot net
Description:
------------
I use mysqli_ping reconnection database when php script long time run.
when my use mysqlnd module, mysqli_ping() is run fail, errormsg is
"MySQL server has gone away".
mysqli.reconnect setting is ON.
mysql server timeout is 30s.
Test script:
---------------
<?php
mysqli = new mysqli("localhost", "xxx", "xxx");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
sleep(31);
/* check if server is alive */
if ($mysqli->ping()) {
printf ("Our connection is ok!\n");
} else {
printf ("Error: %s\n", $mysqli->error);
}
/* close connection */
$mysqli->close();
?>
Expected result:
----------------
Our connection is ok!
Actual result:
--------------
Error: MySQL server has gone away
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52561&edit=1