#chmod() function changes the file mode.
Returns TRUE if successful, otherwise returns FALSE.
Grammar (Recommended learning: PHP programming from entry to proficiency)
chmod(file,mode)
file (required): Required Check the file.
mode (optional): Specifies new permissions.
The mode parameter consists of 4 numbers:
The first number is always 0
The second number specifies the owner's permissions
The second The first number specifies the permissions of the user group to which the owner belongs
The fourth number specifies the permissions of everyone else
Possible values (if you need to set multiple permissions, please set the following Total numbers):
1 - Execute permission
2 - Write permission
4 - Read permission
Example
The above is the detailed content of How to set php file permissions. For more information, please follow other related articles on the PHP Chinese website!