The problem is that when I kill the php process, the map-reduce continues to work.
How can MongoDB know the PHP process was killed, all it sees is a command on a connection came in and that connection is still being used.
This is one reason why you SHOULDN'T run Map Reduce inline to your application and why it is recommended not to.
This same problem applies to web servers when in connection to browsers, a PHP process will conitnue running when a browser is closed.