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!