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

A php script uploads files to my server but folders MUST be 0777 in order to allow PHP to move files there. This is not safe. Additionally, all created directories and uploaded files are owned by apache and not by me. How can I change PHP's configuration so that uploaded files can be moved to a folder with permissions 0755 and created directories are owned by me?

Thank you!

share|improve this question

Create a new group which both you and Apache are a part of. Then you can set permissions to 775. It's not super secure, but its a fast fix from 777ing everything.

share|improve this answer
+1 Thanks, can this be done in mod_php? – Zim3r Sep 24 '12 at 7:29

Either use suPHP or PHP in FastCGI mode with php-fpm.

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.