I'm writing installer for my PHP web app. It requires user to change permissions of a few files and directories (config.php, cache, uploads, .htaccess) to 777 (so that it's writable). I've seen in many applications that installer requires user to revert permissions (for config.php and such) back to 644.
Why is it so important? Why can't I just leave it with 777? I guess it's some kind of security concern, but what exactly can happen if I leave those files writable?