File permissions 600?

See all posts See thread Reply

Re: File permissions 600? new!
by colin, 16 years, 12 months ago
That depends on your server settings. The files are being created by PHP, thus belong to Apache. You can chmod the files, or else use umask() to set the default permissions.

I will probably add a new setting in the class so that the files created by the class can be automatically set with specific permissions.

A bit of information below, from this page
Files created with PHP have default permissions determined by the umask, short for unmask. This can be found by calling the umask() function with no arguments.

The file permissions set are determined by a bitwise and of the umask against the octal number 0777 (or the permissions specified to a PHP function which allows you to do so, such as mkdir("temp",0777) ). In other words, the permissions actually set on a file created by PHP would be 0777 & umask().

A different umask can be set by calling umask() with a numeric argument. Note that this does not default to octal, so umask(777) is not the same as umask(0777). It is always advisable to prefix the 0 to specify that your number is octal.

Given this, it is possible to change the default permissions by adding bits to the umask. A umask is "subtracted" from the default permissions to give the actual permissions, so if the default is 0777 and the umask is 0222, the permissions the file will be given are 0555
Reply