The phpchmod function changes the file mode. When operating files, we often use the chmod function to change the operation permissions of the specified directory. when operating files, we often use the chmod function to change the operation permissions of the specified directory, when operating files, we often use the chmod function to change the operation permissions of the specified directory,
When operating files, we often use the chmod function to change the operation permissions of the specified directory,
Attribute
(PHP 4 and PHP 5)
Change file mode with chmod
Description
Boolean attribute (string $ file name, International $ mode)
Attempts to change the file specified by the mode in the provided mode.
Parameters
File name
File path.
Mode
Note that the mode is not automatically assumed to be the octal value, so the string (such as "Gram + Watt") will not work properly. To ensure the expected operation, you need to set the prefix mode to zero (0 ):
Chmod ("/somedir/somefile", 755); // decimal; probably incorrect
Chmod ("/somedir/somefile", "u + rwx, go + rx"); // string; incorrect
Chmod ("/somedir/somefile", 0755); // octal; correct value of mode
?>
This mode parameter contains three octal components that specify the owner of the access restriction. The owner of the user group is in the same order as others. An integral part can be computed, adding the necessary permissions to this target user group. Number 1 indicates that you are granted the execution right, number 2 indicates that your file is written, and number 4 indicates that your file is readable. These numbers are purchased to specify the required rights. You can also read