Product:
Search Type:

Files which are created with PHP/CGI scripts have different permissions set time to time.

Article ID: 777 
Last Review: Feb,19 2007
APPLIES TO:
  • Plesk for Linux/Unix

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

Please provide feedback on this article

Did this article help you solve your issue?
Yes
No
Partially
I do not know yet
 
Strongly Agree   Strongly Disagree
  9 8 7 6 5 4 3 2 1
The article is easy to understand
The article is accurate
Additional Comments:
*Please provide us with your email address in case we need to contact you.
*Please type the code you can see.
* - required fields