ID: 37319 Updated by: [EMAIL PROTECTED] Reported By: j8859 at clix dot pt -Status: Assigned +Status: Feedback Bug Type: PDO related Operating System: Linux Slackware 10.2 PHP Version: 5.1.3 Assigned To: wez New Comment:
Try following the tips here: http://netevil.org/node.php?uuid=444a6017-0548-2459-2943-44a601714d58 Previous Comments: ------------------------------------------------------------------------ [2006-05-06 09:52:22] j8859 at clix dot pt It occurs also with PHP 5.1.4. ------------------------------------------------------------------------ [2006-05-05 02:40:34] j8859 at clix dot pt Description: ------------ This error also occurs with PHP 5.1.2, but with more frequency than with 5.1.3. It occurs only if I use PDO::ATTR_PERSISTENT => true, and it never occurs with PDO::ATTR_PERSISTENT => false. I have several databases in MySQL, several programs in PHP some using the classic MySQL functions, others using MySQLi, and one using PDO. This is the one which produces errors. The MySQL version is 5.0.18. Apache/1.3.34. If I do a MySQL Flush Tables, the error stops. With PHP 5.1.2 I also need to do an Apache restart to get the error stop occurring. The error never occurred with few MySQL tables opened. I do a diary crontab backup with mysqldump, over the night, and in the morning there are about 220 opened tables. Then, when I use my PDO application, I start getting "MySQL server has gone away" errors. I changed to PDO::ATTR_PERSISTENT => false and the error never happened. I changed back to PDO::ATTR_PERSISTENT => true and the error returned. I know this can be difficult for you to reproduce it, because it is not a deterministic error, but I'm sure there is an error. Reproduce code: --------------- $bd = new PDO(); $query = "SELECT * FROM mytable"; $inst = $this->prepare($query); if(!$inst) die ("ERROR: " . $query . ", " . __FILE__ . ", " . __LINE__); if(!$inst->execute()) { $inst->closeCursor(); return; } while($reg = $inst->fetch(PDO::FETCH_ASSOC)) { // Process $reg } $inst->closeCursor(); $bd = null; ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37319&edit=1