Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 have many VirtualHosts for different users. How can I set UID for PHP process per VirtualHosts?

share|improve this question
up vote 3 down vote accepted

If you are using a Linux distribution then you can probably use suPHP. suPHP allows you to run php scripts with the UID/GID of the php file that is being processed.

You will have to ensure that each of your vhosts has a their own UID/GID.

share|improve this answer
Thanks, suPHP is exactly what I want. – Sannis Mar 23 '11 at 15:11

You could run the php scripts as if they were a CGI and use SuexecUserGroup from mod_suexec to specify which user to run the script as.

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.