RESOLUTION
There is a BUG in PHP, for example http://bugs.php.net/bug.php?id=28401 or http://bugs.php.net/bug.php?id=36630. If you change umask (or other process' environment variables such as Time Zone ) in any PHP script, it will not be returned back to the default value after the HTTP request is finished, but still be applied to the 'httpd' process which ran the script. So, the next time this 'httpd' process will serve any request with umask which was set by the previous script. This way new files are created with different permissions via PHP scripts.Keywords: php cgi script permission issue mask umask 644 600 upload files uploaded change different