0

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!

tundoopani
  • 11
  • 1
  • 5

2 Answers2

1

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.

0

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

womble
  • 96,255
  • 29
  • 175
  • 230