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

We have Development Server with apache 2.2 and php5. Here developers are accessing the server using the individual samba login for uploading the files into the server. But when creating the folder and files using the php code, it creating under the apache user and group perm. So, may i know how to create the folder and file using php code under individual login. Is there any changes need to done in php.ini or apache configuration file.

share|improve this question
up vote 0 down vote accepted

Two solutions:

  • to use PHP as your user (which might be dangerous)
  • set the gid on that folder (g+s) so all the files created there will belong to your user's group as well (and not apache's)
share|improve this answer
This helped me as well, however, when apache creates files, they have group perms set to r-- and r-x for directories. So, the group that the user belongs to does not have perms to delete/modify the file. How can I overcome this? – Code Poet Jul 24 '12 at 5:49

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.