Yes. There are lots of ways to do this.
The truth is that your question isn't really a PHP question - it's really a sysadmin / web hosting question.
It's good that you recognize this as dangerous. It's also good that you're realistic about your skills and experience level.
If your goal is to learn how to get this done, you have years worth of work to do to gain the skills to administer a multi user server. If we wrote 500 pages of instruction here to help you along, it wouldn't be enough. Start small and build your way up to what you are proposing.
If your goal is to get this project done, your best bet is to get a web server and hire a sysadmin who has experience with chroot or vserver environments - or even normal Unix permissions. Frankly, though, web hosting (far better than you describe) can be had for about four bucks a month which is essentially free.
Unless you are doing this for your own learning purposes and to gain experience, it just doesn't make sense to spend thousands of hours learning to build this system when people can get something way better for four bucks a month.