I have developed an online java code editor at http://joomla5.guru99.com/try-java-editor.html I am invoking javac using shell_exec function of php and executing java code.
$result = shell_exec('javac' .$soucejavafile. '2>&1');
and running classfile by
$result= shell_exec('java' .$classfile. '2>&1');
Now for security purpose, I want to set time limit for this java code execution. For example, java code execution should be stopped after some amount time and all it's processes must be killed
I have tried ulimit and ps commands but couldn't able to achieve this.
Please assist me in the correct direction and please help me to make this possible.
Regards.