#23649 [NEW]: Lost connection to MySQL server during query after pcntl_fork

From: Date: Thu, 15 May 2003 22:41:58 +0000
Subject: #23649 [NEW]: Lost connection to MySQL server during query after pcntl_fork
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-39739@lists.php.net to get a copy of this message
From: sthomas at townnews dot com Operating system: Redhat Linux 9.0 PHP version: 4.3.2RC2 PHP Bug Type: MySQL related Bug description: Lost connection to MySQL server during query after pcntl_fork To reproduce, simply run this script from the PHP CLI: <?PHP print "This is before the fork!\n"; mysql_connect('remote.host', 'user', 'pass'); mysql_select_db('database'); print "Query 1:"; mysql_query('select 1'); print mysql_error(); print "\n"; if (pcntl_fork()) exit(); print "Query 2:"; mysql_query('select 1'); print mysql_error(); print "\n"; mysql_close(); ?> This will almost always produce a "Lost connection to MySQL server during query" error for the second query. Though I did notice that it seems to happen only if the host is a remote host. We are using PHP 4.0.12 as the server, and this bug seems to occour whether we use the included mysql client libraries or compile against the 4.0.12 libraries. -- Edit bug report at http://bugs.php.net/?id=23649&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=23649&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=23649&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=23649&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=23649&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=23649&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=23649&r=support Expected behavior: http://bugs.php.net/fix.php?id=23649&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=23649&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=23649&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=23649&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23649&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=23649&r=dst IIS Stability: http://bugs.php.net/fix.php?id=23649&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=23649&r=gnused

« previous php.bugs (#39739) next »