Realistically the only way that a persistent php 'controller' process can avoid this is to fork() a new process for every script execution that it can kill via OS controls afterwards, or better yet just use the OS-provided rlimits to control memory use, CPU use, etc.
So long as it uses a single process to run multiple scripts it simply can't provide any realistic controls over what non-interpreted code does.
Realistically the only way that a persistent php 'controller' process can avoid this is to fork() a new process for every script execution that it can kill via OS controls afterwards, or better yet just use the OS-provided rlimits to control memory use, CPU use, etc.
So long as it uses a single process to run multiple scripts it simply can't provide any realistic controls over what non-interpreted code does.
There may not be a happy solution here.
Thanks