Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

most of them use apache module mod_userdir :

share|improve this answer

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


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.