I'm working on a web app that can allow the user to input some code, and it will be compiled and executed, and they can see the result. I'm coding the app in PHP and I need a way to ensure that if the user inputs some harmful code (this example is PHP), it can't execute and destroy my server. Example:
<?php
shell_exec('rm -rf /');
?>
I'm thinking that permissions on the uploaded code's file might do it just fine, but I wanted some secondary input. Thanks!