Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am kind of curious, how does a hosting server support multiple users with php but keep each user away from the other code? The 'easy' solution i thought were file permissions. So every user can have www-data belong to their group and the server would have executing access but the users cant access the others file.

But then i realize the user running the php would be www-data who has permission to read everyones data. So how does a shared host prevent this from happening?

PS: I personally use nginx (with fastcgi php). But i am somewhat familiar on how apache works.

share|improve this question

2 Answers 2

PHP has a basedir configuration that will limit each virtualhost to a sub-folder.

See http://stackoverflow.com/questions/2781185/php-a-different-open-basedir-per-each-virtual-host

share|improve this answer

most of them use apache module mod_userdir : http://httpd.apache.org/docs/2.0/mod/mod_userdir.html

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.