While you could farm work out to other programs using exec
and friends, the thing you're trying to do is best accomplished using a message queue system. A well-designed message queue will let you write worker programs in any language you need. They're a great solution when you need to do something in another language, environment, or server.
There are lots of message queues, but I'm a big fan of Gearman. It was built by the same folks that brought us memcached. Take a peek at the PECL extension.