I have a set of code that looks something like:
This is more psuedo code but you can get the idea
function doget($doexec)
{
if ($doexec)
exec("getstuff. php");
else
{
// the same code in getstuff.php
$i = new getstuff();
mysql PEAR procedures to store data
}
}
$CHILD_PID = pcntl_fork();
if($CHILD_PID == 0)
{
doget(FALSE);
posix_kill(getm ypid(),9);
}
If I do this with doget (TRUE) then everything works but if I do this
doget(FALSE) then mysql loses the connection. I reinstantiate my db
class for every new child, is this common or am I approaching this
incorrectly?
Does this have something to do with the Zend optmizer? I am running php
5.0.3 with mysql 4.1.x on Freebsd 5.1
This is more psuedo code but you can get the idea
function doget($doexec)
{
if ($doexec)
exec("getstuff. php");
else
{
// the same code in getstuff.php
$i = new getstuff();
mysql PEAR procedures to store data
}
}
$CHILD_PID = pcntl_fork();
if($CHILD_PID == 0)
{
doget(FALSE);
posix_kill(getm ypid(),9);
}
If I do this with doget (TRUE) then everything works but if I do this
doget(FALSE) then mysql loses the connection. I reinstantiate my db
class for every new child, is this common or am I approaching this
incorrectly?
Does this have something to do with the Zend optmizer? I am running php
5.0.3 with mysql 4.1.x on Freebsd 5.1