Sounds like an extremely bad idea.
One possibility is to run the users' PHP under a different web server instance / user than your own code, and using something like SELinux to set an advanced security model for it to severely limit what they can do.
Another is to use safe_mode, but it isn't as safe as it should be and it's a pain in the arse.
Either way you'll also want to disable a lot of functions with disable_functions in php.ini
disable_functions = dl,exec,passthru,system,shell_exec,popen
And that's just for starters. I make no claim that doing any of these things will leave your server safe.
Mark