/* This code works */ include_once('../classes/Dispatcher.class.php'); include_once('../classes/WorkQueue.class.php'); $workQueue = new WorkQueue(); $dispatcher = new Dispatcher($workQueue); $processlist = new ProcessList($workQueue); $dispatcher->queueJobs(); $processlist->checkQueue(); ---------------------------------------------------------------------------- /* This doesn't */ include_once('../classes/Dispatcher.class.php'); include_once('../classes/WorkQueue.class.php'); $workQueue = new WorkQueue(); $dispatcher = new Dispatcher($workQueue); $processlist = new ProcessList($workQueue); $pid = pcntl_fork(); if ($pid == -1) { die('could not fork'); } else if ($pid) { $dispatcher->queueJobs(); } else { $processlist->checkQueue(); }