You shouldn't have a database handle open over a fork call. Open it after the fork. I have no idea how to do that, since it seems to be happening implicitly, or at least in part of your code not shown. You might want to ask in a forum specific to php PDO. Also, shouldn't you be testing $pid against -1, not +1?