Possible duplicate:
PHP sandbox / sanitize code passed to create_function
I apologize for a very generalized question, but I need to be guided. What is the most ideal way to execute user submitted PHP code? Think about JSFiddle for PHP. I know that there are sites that do this, for example http://writecodeonline.com/php/ , but I think that PHP4 does not work with half the code that I try to run on it. I also know that I can just turn off all the "risky" functions, but thatโs not fun :)
I know that it would be very convenient to have PHPFiddle.com, which we could refer to StackOverflow in the same way we used to rely on JSfiddle or JSbin.
I think itโs something like creating a virtual host on my mailbox, so any file system features that the user is trying to use will be limited to this sandbox. I am not sure how to do this, or if this leads to the fact that my server will work with several of them.
Ideas?
source share