#23649 [Opn->Fbk]: Lost connection to MySQL server during query after pcntl_fork
| From: | sniper@php.net | Date: | Thu, 15 May 2003 23:51:41 +0000 |
| Subject: | #23649 [Opn->Fbk]: Lost connection to MySQL server during query after pcntl_fork | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-39746@lists.php.net to get a copy of this message | ||
ID: 23649
Updated by: sniper@php.net
Reported By: sthomas at townnews dot com
-Status: Open
+Status: Feedback
Bug Type: MySQL related
Operating System: Redhat Linux 9.0
PHP Version: 4.3.2RC2
New Comment:
Does this work if you don't have pcntl_fork() there?
Previous Comments:
------------------------------------------------------------------------
[2003-05-15 17:41:58] sthomas at townnews dot com
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 this bug report at http://bugs.php.net/?id=23649&edit=1