Remember that if this is a web application, it will (normally) be executed as the Apache user, and as such can only kill processes it owns.
If you're looking to spawn processes from within PHP, take a look at [man]proc_open/man and its related functions, including [man]proc_terminate/man.