The standard version of PHP accesses the web hosting server with a user called «wwwrun» and not your user. This standard version of PHP consumes fewer system resources, but will lead to problems as soon as you use a CMS, shop system or similar in the context of a file upload. As in our description, you could now set the permissions to 777 but doing so would grant access to all users on this server. Any user with knowledge of this path can access these files. In other words, this is highly problematic in terms of security.
Using PHP in FastCGI mode offers a solution to this problem. If you update the PHP version to a FastCGI version, PHP uses your username to access the files. This has another advantage, namely, that you do not have to worry about the permissions for the directories and files because PHP automatically does this correctly.