I'd like to setup a multiuser PHP virtualhosting environment.

However, here comes my big concern. Users could use the PHP filesystem functions to access the other users directories, thus read the source files and gaining inmediate access to databases passwords and other kind of sensitive data.

I've been looking at lots of resources in order to address this issue. However, none of them seems satisfactory to me.

Is there any way to run PHP in a setuid environment for each of the VirtualHosts defined by Apache? Has anyone already gone through this setup which can guide me on the steps required for doing so? How are the big hosting companies doing it?

Thanks,
Corin